Continuous Integration #5246
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: Continuous Integration | |
| on: | |
| merge_group: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| schedule: | |
| # UTC | |
| - cron: '48 4 * * *' | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| style: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: thumbv7em-none-eabihf | |
| components: clippy,rustfmt | |
| - run: cargo fmt --all -- --check | |
| - run: cargo clippy | |
| - run: cargo check --all --verbose | |
| - uses: actions/setup-python@v1 | |
| with: | |
| python-version: 3.12 | |
| - run: | | |
| python -m pip install --upgrade pip | |
| pip install py/ | |
| pip install pylint | |
| - run: | | |
| pylint py/stabilizer | |
| compile: | |
| runs-on: ubuntu-latest | |
| continue-on-error: ${{ matrix.continue-on-error }} | |
| strategy: | |
| matrix: | |
| toolchain: [stable] | |
| features: [''] | |
| continue-on-error: [false] | |
| include: | |
| - toolchain: beta | |
| features: '' | |
| continue-on-error: true | |
| - toolchain: nightly | |
| features: nightly | |
| continue-on-error: true | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: ${{ matrix.toolchain }} | |
| targets: thumbv7em-none-eabihf | |
| - run: cargo build --release --features "${{ matrix.features }}" | |
| schema: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: dtolnay/rust-toolchain@stable | |
| # https://github.com/rust-lang/cargo/issues/13051 | |
| - run: cargo run --bin dual-iir --target x86_64-unknown-linux-gnu | |
| - run: cargo run --bin lockin --target x86_64-unknown-linux-gnu | |
| - run: cargo run --bin dds --target x86_64-unknown-linux-gnu | |
| doc: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: thumbv7em-none-eabihf | |
| - uses: Swatinem/rust-cache@v1 | |
| - uses: peaceiris/actions-mdbook@v1 | |
| with: | |
| mdbook-version: '0.4.12' | |
| - run: cargo install cargo-deadlinks | |
| - run: cargo install mdbook-linkcheck | |
| - run: | | |
| cargo doc --no-deps \ | |
| -p miniconf -p idsp \ | |
| -p ad9959 -p ad9912 -p stream -p platform -p signal_generator \ | |
| -p encoded_pin -p serial_settings -p urukul \ | |
| -p stabilizer | |
| # We intentionally ignore fragments, as RTIC may generate fragments for various | |
| # auto-generated code. | |
| - run: cargo deadlinks --dir target/thumbv7em-none-eabihf/doc --ignore-fragments --check-intra-doc-links | |
| continue-on-error: true | |
| - name: build | |
| run: | | |
| mv ../target/thumbv7em-none-eabihf/doc src/firmware | |
| mdbook build | |
| working-directory: book | |
| hitl-trigger: | |
| runs-on: ubuntu-latest | |
| environment: hitl | |
| # This crucially marks the job as "skipped" when not in the merge queue thus | |
| # counting as passing the required check when adding it to the merge queue. | |
| # See | |
| # https://docs.github.com/en/actions/using-jobs/using-conditions-to-control-job-execution#overview | |
| if: ${{ github.event_name == 'merge_group' }} | |
| steps: | |
| - uses: LouisBrunner/checks-action@v1.1.1 | |
| id: hitl-check | |
| with: | |
| repo: ${{ github.repository }} | |
| sha: ${{ github.event.head_commit.id }} | |
| token: ${{ github.token }} | |
| name: HITL Run Status | |
| status: in_progress | |
| details_url: "https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}" | |
| output: | | |
| {"summary": "Starting..."} | |
| - uses: peter-evans/repository-dispatch@v1 | |
| with: | |
| token: ${{ secrets.DISPATCH_PAT }} | |
| event-type: stabilizer | |
| repository: quartiq/hitl | |
| client-payload: | | |
| {"github": ${{ toJson(github) }}, "check_id": ${{steps.hitl-check.outputs.check_id}}} | |
| - uses: fountainhead/action-wait-for-check@v1.0.0 | |
| id: status | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| checkName: HITL Run Status | |
| ref: ${{ github.event.pull_request.head.sha }} | |
| # The HITL can be backlogged by multiple queues, where each takes ~5 minutes to complete. | |
| timeoutSeconds: 3600 | |
| - name: "Check HITL Status" | |
| if: steps.status.outputs.conclusion != 'success' | |
| run: exit -1 |