Metapac migration #1
Workflow file for this run
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: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| env: | |
| # Sibling repos consumed via workspace path deps + [patch.crates-io]. | |
| # Bump in lockstep with Cargo.toml when those interfaces change. | |
| CH32_DATA_REPO: ch32-rs/ch32-data | |
| CH32_DATA_REF: 6f94309ec3bc7480b9686c3119284df833050c54 | |
| PROBE_RS_REPO: probe-rs/probe-rs | |
| PROBE_RS_REF: cdcb14d01eac0fa7966dc246a5b3572e0494c8ad | |
| jobs: | |
| fmt-clippy: | |
| name: fmt + clippy | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| path: flash-algorithms | |
| - uses: actions/checkout@v4 | |
| with: | |
| repository: ${{ env.CH32_DATA_REPO }} | |
| ref: ${{ env.CH32_DATA_REF }} | |
| path: ch32-data | |
| - uses: actions/checkout@v4 | |
| with: | |
| repository: ${{ env.PROBE_RS_REPO }} | |
| ref: ${{ env.PROBE_RS_REF }} | |
| path: probe-rs | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: rustfmt, clippy | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| workspaces: | | |
| flash-algorithms | |
| ch32-data | |
| shared-key: fmt-clippy | |
| - name: cargo fmt --check | |
| working-directory: flash-algorithms | |
| run: cargo fmt --all -- --check | |
| - name: generate ch32-metapac | |
| working-directory: ch32-data | |
| run: ./d gen | |
| - name: cargo clippy -p xtask | |
| working-directory: flash-algorithms | |
| run: cargo clippy -p xtask -- -D warnings | |
| algos: | |
| name: algos/${{ matrix.crate }} | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| crate: [v0, v00x, v1, v3, l1, x0] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| path: flash-algorithms | |
| - uses: actions/checkout@v4 | |
| with: | |
| repository: ${{ env.CH32_DATA_REPO }} | |
| ref: ${{ env.CH32_DATA_REF }} | |
| path: ch32-data | |
| # Needed even for algo-only builds: workspace [patch.crates-io] | |
| # is loaded eagerly, so cargo refuses without the path. | |
| - uses: actions/checkout@v4 | |
| with: | |
| repository: ${{ env.PROBE_RS_REPO }} | |
| ref: ${{ env.PROBE_RS_REF }} | |
| path: probe-rs | |
| - uses: dtolnay/rust-toolchain@nightly | |
| with: | |
| components: rust-src | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| workspaces: | | |
| flash-algorithms | |
| ch32-data | |
| key: ${{ matrix.crate }} | |
| - name: generate ch32-metapac | |
| working-directory: ch32-data | |
| run: ./d gen | |
| - name: cargo build --release | |
| working-directory: flash-algorithms/algos/${{ matrix.crate }} | |
| run: cargo build --release | |
| render: | |
| name: render YAMLs | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| path: flash-algorithms | |
| - uses: actions/checkout@v4 | |
| with: | |
| repository: ${{ env.CH32_DATA_REPO }} | |
| ref: ${{ env.CH32_DATA_REF }} | |
| path: ch32-data | |
| - uses: actions/checkout@v4 | |
| with: | |
| repository: ${{ env.PROBE_RS_REPO }} | |
| ref: ${{ env.PROBE_RS_REF }} | |
| path: probe-rs | |
| - uses: dtolnay/rust-toolchain@nightly | |
| with: | |
| components: rust-src | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| workspaces: | | |
| flash-algorithms | |
| ch32-data | |
| shared-key: render | |
| - name: generate ch32-metapac | |
| working-directory: ch32-data | |
| run: ./d gen | |
| - name: cargo run -p xtask | |
| working-directory: flash-algorithms | |
| run: cargo run -p xtask |