This repository has been archived by the owner on Sep 18, 2024. It is now read-only.
update action #44
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: build | |
on: | |
pull_request: | |
branches: [ "main" ] | |
push: | |
branches: [ "main" ] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
changed-files: | |
name: changed-files | |
runs-on: ubuntu-latest | |
outputs: | |
src: ${{ steps.changed-files-yaml.outputs.src_any_changed }} | |
gpu: ${{ steps.changed-files-yaml.outputs.gpu_any_changed }} | |
steps: | |
- uses: actions/checkout@v4 | |
- id: changed-files-yaml | |
uses: tj-actions/changed-files@v44 | |
with: | |
files_yaml: | | |
src: | |
- '**/*.rs' | |
- '**/Cargo.toml' | |
gpu: | |
- '**/*.rs' | |
- '**/Cargo.toml' | |
- '**/*.comp' | |
test: | |
needs: changed-files | |
name: test-on-${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
steps: | |
- uses: actions/checkout@v4 | |
if: ${{ needs.changed-files.outputs.src == 'true' }} | |
- uses: ./.github/actions/setup-build | |
with: | |
os: ${{ matrix.os }} | |
shaderc: false | |
if: ${{ needs.changed-files.outputs.src == 'true' }} | |
- run: | | |
cargo build --features "plotters python" | |
cargo test --features "plotters python" | |
shell: bash | |
if: ${{ needs.changed-files.outputs.src == 'true' }} | |
test-gpu: | |
needs: changed-files | |
name: test-on-${{ matrix.os }}-with-gpu | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
steps: | |
- uses: actions/checkout@v4 | |
if: ${{ needs.changed-files.outputs.gpu == 'true' }} | |
- uses: ./.github/actions/setup-build | |
with: | |
os: ${{ matrix.os }} | |
shaderc: true | |
if: ${{ needs.changed-files.outputs.gpu == 'true' }} | |
- run: | | |
cargo build --features "plotters python gpu" | |
cargo test --features "plotters python gpu" | |
shell: bash | |
if: ${{ needs.changed-files.outputs.gpu == 'true' }} | |
lint: | |
needs: changed-files | |
name: lint | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
if: ${{ needs.changed-files.outputs.src == 'true' }} | |
- uses: ./.github/actions/setup-build | |
with: | |
os: ubuntu-latest | |
shaderc: true | |
if: ${{ needs.changed-files.outputs.src == 'true' }} | |
- run: | | |
cargo clippy --features "plotters python" -- -D warnings | |
cargo clippy --features "plotters python gpu" -- -D warnings | |
if: ${{ needs.changed-files.outputs.src == 'true' }} | |
auto-merge: | |
needs: | |
- test | |
- test-gpu | |
- lint | |
permissions: | |
pull-requests: write | |
contents: write | |
runs-on: ubuntu-latest | |
if: ${{ always() && !cancelled() && !failure() && github.actor == 'dependabot[bot]' }} | |
steps: | |
- run: gh pr merge --rebase --auto "$PR_URL" | |
env: | |
PR_URL: ${{github.event.pull_request.html_url}} | |
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} |