Skip to content

fix(sjv): broken tests #436

fix(sjv): broken tests

fix(sjv): broken tests #436

Workflow file for this run

name: CI
on:
push:
branches:
- master
- develop
paths-ignore:
- 'README.md'
- 'LICENSE'
- '.gitignore'
- '.vscode/**'
tags:
- v*
pull_request:
branches:
- master
- develop
paths-ignore:
- 'README.md'
- 'LICENSE'
- '.gitignore'
- '.vscode/**'
merge_group:
env:
CARGO_TERM_COLOR: always
PKG_CONFIG_SYSROOT_DIR: /
permissions:
contents: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
tests:
runs-on: ubuntu-24.04
if: ${{ !startsWith(github.event.head_commit.message, 'docs:') || !contains(github.event.head_commit.message, 'skip ci') }}
steps:
- name: Checkout repo
uses: actions/checkout@9a9194f87191a7e9055e3e9b95b8cfb13023bb08
with:
submodules: 'true'
- name: Rustup stable
run: |
rustup update stable
- name: Setup rust cache
uses: Swatinem/rust-cache@9bdad043e88c75890e36ad3bbc8d27f0090dd609
with:
prefix-key: "${{ runner.os }}-tosho-rust"
- name: Test
run: cargo test --verbose --all
build:
needs: tests
strategy:
matrix:
os:
# GNU Linux (x64)
- [ubuntu-24.04, x86_64-unknown-linux-gnu]
# macOS Intel (x64)
- [macos-13, x86_64-apple-darwin]
# macOS Apple Silicon (ARM64)
- [macos-14, aarch64-apple-darwin]
# Windows Server 2022 (x64)
- [windows-2022, x86_64-pc-windows-msvc]
fail-fast: false
runs-on: ${{ matrix.os[0] }}
steps:
- name: Checkout repo
uses: actions/checkout@9a9194f87191a7e9055e3e9b95b8cfb13023bb08
- name: Rust Target
run: |
rustup update stable
rustup target add ${{ matrix.os[1] }}
- name: Setup rust cache
uses: Swatinem/rust-cache@9bdad043e88c75890e36ad3bbc8d27f0090dd609
with:
prefix-key: "${{ runner.os }}-${{ matrix.os[1] }}-tosho-build-rust"
- name: Prepare build
if: matrix.os[0] != 'windows-latest'
run: |
sed -i'' -e 's/# CI-PROFILE-MARK/[profile.release]\nopt-level = "z"\nlto = true\ncodegen-units = 1\npanic = "abort"\nstrip = "debuginfo"/g' Cargo.toml
shell: bash
- name: Prepare build (Win32)
if: matrix.os[0] == 'windows-latest'
run: |
sed -i'' -e 's/# CI-PROFILE-MARK/[profile.release]\nopt-level = "z"\nlto = true\ncodegen-units = 1\npanic = "abort"/g' Cargo.toml
- name: Build (Nightly)
if: startsWith(github.ref, 'refs/tags/v') != true
run: |
cargo build --release --verbose --all --target ${{ matrix.os[1] }}
shell: bash
- name: Permissions (Nightly)
if: startsWith(github.ref, 'refs/tags/v') != true && matrix.os[0] != 'windows-latest'
run: |
chmod +x target/${{ matrix.os[1] }}/release/tosho
shell: bash
- name: Upload artifact
if: startsWith(github.ref, 'refs/tags/v') != true
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a
with:
name: tosho-${{ matrix.os[1] }}
path: |
target/${{ matrix.os[1] }}/release/tosho.exe
target/${{ matrix.os[1] }}/release/tosho
- name: Build (Release)
if: startsWith(github.ref, 'refs/tags/v')
run: |
cargo build --release --verbose --all --target ${{ matrix.os[1] }}
shell: bash
env:
RELEASE: true
- name: Prepare release
if: matrix.os[0] != 'windows-latest' && startsWith(github.ref, 'refs/tags/v')
shell: bash
run: |
cd target/${{ matrix.os[1] }}/release
chmod +x tosho
tar -czvf tosho-${{ matrix.os[1] }}.tar.gz tosho
mv tosho-${{ matrix.os[1] }}.tar.gz ../../..
cd ../../..
- name: Prepare release (Win32)
if: matrix.os[0] == 'windows-latest' && startsWith(github.ref, 'refs/tags/v')
run: |
cd target/${{ matrix.os[1] }}/release
Compress-Archive -Path tosho.exe -DestinationPath tosho-${{ matrix.os[1] }}.zip
mv tosho-${{ matrix.os[1] }}.zip ../../..
cd ../../..
- name: Upload artifact
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a
if: startsWith(github.ref, 'refs/tags/v')
with:
name: tosho-packages-${{ matrix.os[1] }}
path: |
tosho-${{ matrix.os[1] }}.zip
tosho-${{ matrix.os[1] }}.tar.gz
releases:
runs-on: ubuntu-latest
needs: build
if: startsWith(github.ref, 'refs/tags/v') && github.repository_owner == 'noaione'
permissions:
contents: write
discussions: write
steps:
- name: Checkout repo
uses: actions/checkout@9a9194f87191a7e9055e3e9b95b8cfb13023bb08
- name: Download artifacts
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16
with:
path: tosho-packages
pattern: tosho-packages-*
merge-multiple: true
- name: Create changelog
id: prepare-change
run: |
python3 scripts/create_changelog.py
# Fetch git tag contents subject
VERSION_SUBJ=$(git tag -l --format='%(contents:subject)' ${{ github.ref }})
echo "version_subject=$VERSION_SUBJ" >> "$GITHUB_OUTPUT"
env:
VERSION: ${{ github.ref }}
- name: Release
uses: softprops/action-gh-release@9a28f2423fd7ba2781181bb13e8aba228027c4e9
with:
files: |
tosho-packages/*
draft: false
prerelease: false
token: ${{ secrets.GITHUB_TOKEN }}
body_path: CHANGELOG-GENERATED.md
name: ${{ steps.prepare-change.outputs.version_subject }}
- name: Create discussions
uses: nvdaes/build-discussion@44180020a97632aa87af4f9452d9bf78c35b25e5
with:
title: Release ${{ github.ref_name }}
body: |
Release **${{ github.ref_name }}** is now available for **[download](https://github.com/noaione/tosho-mango/releases/tag/${{ github.ref_name }})**.
Please see the [changelog](https://github.com/noaione/tosho-mango/blob/master/CHANGELOG.md) for more information.
Report any issues you found in the [issue tracker](https://github.com/noaione/tosho-mango/issues/new/choose)
category-position: 1 # Announcements