Feature/next #49
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: Pull Request | |
# Jobs in this workflow are all required run successfully before the PR can be merged. This is enforced by using github status checks. | |
# What's github status check: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/collaborating-on-repositories-with-code-quality-features/about-status-checks | |
on: | |
pull_request: | |
types: [opened, synchronize] | |
merge_group: | |
push: | |
branches: | |
- main | |
- 'renovate/**' # For renovate bot "automerge": true | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} | |
cancel-in-progress: ${{ github.ref_name != 'main' }} | |
jobs: | |
# JOB to run change detection | |
changes: # https://github.com/dorny/paths-filter | |
name: Detect Changes | |
runs-on: ubuntu-latest | |
permissions: | |
pull-requests: read | |
outputs: | |
rust-changes: ${{ (steps.filter.outputs.rust-changes == 'true') || (github.ref_name == 'main') }} | |
node-changes: ${{ (steps.filter.outputs.node-changes == 'true') || (github.ref_name == 'main') }} | |
steps: | |
# For pull requests it's not necessary to checkout the code | |
- uses: actions/checkout@v4 #Fix https://github.com/dorny/paths-filter/issues/212 | |
- uses: dorny/paths-filter@v3 | |
id: filter | |
with: | |
filters: | | |
rust-changes: &rust-changes | |
- '.github/workflows/**' | |
- 'crates/**' | |
- 'Cargo.toml' | |
- 'Cargo.lock' | |
- 'rust-toolchain.toml' | |
- 'deny.toml' | |
- '.gitattributes' | |
node-changes: | |
- *rust-changes | |
- 'packages/**' | |
- 'examples/**' | |
- 'scripts/**' | |
- 'package.json' | |
- 'pnpm-lock.yaml' | |
- 'pnpm-workspace.yaml' | |
- name: Show outputs | |
run: | | |
echo "Rust changes: ${{ (steps.filter.outputs.rust-changes == 'true') || (github.ref_name == 'main') }}" | |
echo "Node changes: ${{ (steps.filter.outputs.node-changes == 'true') || (github.ref_name == 'main') }}" | |
cargo-test: | |
needs: changes | |
strategy: | |
matrix: | |
target: [ubuntu-latest, macos-latest, windows-latest] | |
runs-on: ${{ matrix.target }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Rust | |
uses: ./.github/actions/setup-rust | |
with: | |
tools: just | |
cache-key: debug-build | |
components: clippy rustfmt | |
- name: Run Tests | |
run: cargo test --workspace -- --test-threads=1 --nocapture |