Merge pull request #33 from rex-rs/electrode #1
This file contains hidden or 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: Meson Build and Test | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref_name }} | |
| cancel-in-progress: true | |
| on: | |
| push: | |
| branches: [main, ci] | |
| pull_request: | |
| branches: [main] | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| changes: | |
| if: github.repository == 'rex-rs/rex' | |
| runs-on: ubuntu-latest | |
| permissions: | |
| pull-requests: read | |
| outputs: | |
| meson: ${{ steps.filter.outputs.meson }} | |
| nix: ${{ steps.filter.outputs.nix }} | |
| steps: | |
| # For pull requests it's not necessary to checkout the code | |
| - uses: actions/checkout@v4 | |
| - uses: dorny/paths-filter@v3 | |
| id: filter | |
| with: | |
| predicate-quantifier: 'every' | |
| filters: | | |
| nix: &nix | |
| - '**' | |
| - '!docs/**' | |
| - '!tools/**' | |
| - '!**/*.md' | |
| meson: | |
| - *nix | |
| - '!flake.nix' | |
| - '!flake.lock' | |
| build_and_test: | |
| needs: changes | |
| if: ${{ needs.changes.outputs.meson == 'true' }} | |
| runs-on: [self-hosted, gentoo] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Cache Rex build directory | |
| uses: actions/cache@v3 | |
| with: | |
| path: build | |
| key: ${{ runner.os }}-${{ runner.name }}-meson-${{ hashFiles('rex-native.ini', 'meson.build') }} | |
| - name: Setup Rex build directory | |
| run: meson setup --native-file rex-native.ini --reconfigure ./build | |
| - name: Compile Rex deps | |
| run: meson compile -C build build_deps | |
| - name: Compile Rex samples | |
| run: meson compile -C build | |
| - name: Run Rex sanity tests | |
| run: meson test -C build | |
| build_with_nix: | |
| needs: changes | |
| if: ${{ needs.changes.outputs.nix == 'true' }} | |
| runs-on: [self-hosted, nix] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Setup Rex build directory | |
| run: meson setup --native-file rex-native.ini --reconfigure ./build | |
| shell: nix develop -v -L .#rex --command bash -e {0} | |
| - name: Compile Rex deps | |
| run: meson compile -C build build_deps | |
| shell: nix develop -v -L .#rex --command bash -e {0} | |
| - name: Compile Rex samples | |
| run: meson compile -C build | |
| shell: nix develop -v -L .#rex --command bash -e {0} |