Upload assets dividing by kind #265
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: namui-linux-host-x86_64-unknown-linux-gnu | |
on: | |
pull_request: | |
concurrency: | |
group: ${{ github.ref }}-namui-linux-host-x86_64-unknown-linux-gnu | |
cancel-in-progress: true | |
env: | |
CARGO_INCREMENTAL: 0 | |
RUSTFLAGS: -D warnings | |
jobs: | |
list-projects: | |
runs-on: ubuntu-latest | |
outputs: | |
project-dirs: ${{ steps.project-dirs.outputs.dirs }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Output list of project directories | |
id: project-dirs | |
run: cargo run --manifest-path ./github-actions-tools/matrix-output/Cargo.toml x86_64-unknown-linux-gnu $GITHUB_OUTPUT dirs | |
run-commands: | |
runs-on: ubuntu-latest | |
needs: | |
- list-projects | |
strategy: | |
matrix: | |
dir: ${{ fromJSON(needs.list-projects.outputs.project-dirs) }} | |
env: | |
CARGO_LOCK_PATH: ${{ matrix.dir }}/Cargo.lock | |
CARGO_VERSION: "" # Should be set in the job | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y libasound2-dev | |
- name: Set up cargo | |
run: | | |
rustup update | |
- run: CARGO_VERSION=$(cargo --version | cut -d ' ' -f 2) && echo "CARGO_VERSION=$CARGO_VERSION" >> $GITHUB_ENV | |
- uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/ | |
${{ matrix.dir }}/target/ | |
key: ${{ runner.os }}-${{ env.CARGO_VERSION }}-linux-x86_64-unknown-linux-gnu-${{ matrix.dir }}-${{ hashFiles(env.CARGO_LOCK_PATH) }} | |
restore-keys: | | |
${{ runner.os }}-${{ env.CARGO_VERSION }}-linux-x86_64-unknown-linux-gnu-${{ matrix.dir }}- | |
${{ runner.os }}-${{ env.CARGO_VERSION }}-linux-x86_64-unknown-linux-gnu- | |
- name: Run commands | |
working-directory: ${{ matrix.dir }} | |
run: | | |
echo "Running commands in ${{ matrix.dir }}" | |
echo "cargo check --tests" | |
cargo check --tests | |
echo "cargo fmt" | |
cargo fmt | |
echo "cargo clippy --tests" | |
cargo clippy --tests | |
echo "cargo test" | |
cargo test | |
post-namui-linux-host-x86_64-unknown-linux-gnu: | |
if: always() | |
runs-on: ubuntu-latest | |
needs: | |
- run-commands | |
steps: | |
- run: | | |
echo ${{ join(needs.*.result, ',') }} | |
any_test_failed=${{ contains(join(needs.*.result, ','), 'failure') }} | |
echo $any_test_failed | |
if [[ $any_test_failed == "true" ]]; then | |
echo "::error::There are failed job" | |
exit 1 | |
else | |
echo "Good. No test failed" | |
fi |