diff options
| author | datdenkikniet <jcdra1@gmail.com> | 2025-03-22 23:15:04 +0100 |
|---|---|---|
| committer | datdenkikniet <38322042+datdenkikniet@users.noreply.github.com> | 2025-03-23 09:57:48 +0000 |
| commit | 5de3ca0aef627f9d4d095e386c3b833d35477685 (patch) | |
| tree | 62bb53fca4cd0d13c003dfafc0f0ac764a7d3a5e /.github | |
| parent | 414d759ed936307aad7f46534d176666c738b314 (diff) | |
ci: use reusable workflow
Diffstat (limited to '.github')
| -rw-r--r-- | .github/workflows/build.yml | 84 | ||||
| -rw-r--r-- | .github/workflows/clippy-check-example.yml | 56 |
2 files changed, 68 insertions, 72 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e0ed66b..a18fcd7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -33,10 +33,15 @@ jobs: - name: cargo xtask fmt run: cargo xtask --verbose fmt -c - # Compilation check - check: - name: check - runs-on: ubuntu-22.04 + # Verify all examples, checks + check-clippy: + uses: ./.github/workflows/clippy-check-example.yml + with: + backend: ${{ matrix.input.backend }} + platform: ${{ matrix.input.platform }} + rustup-target: ${{ matrix.input.rustup-target }} + example-args: ${{ matrix.input.example-args }} + strategy: matrix: input: @@ -51,6 +56,7 @@ jobs: - backend: thumbv8-base platform: lm3s6965 rustup-target: thumbv8m.base-none-eabi + example-args: --exampleexclude pool - backend: thumbv8-main platform: lm3s6965 @@ -67,20 +73,9 @@ jobs: - backend: riscv-esp32-c3 platform: esp32-c3 rustup-target: riscv32imc-unknown-none-elf - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Configure Rust target ${{ matrix.input.rustup-target }} - run: rustup target add ${{ matrix.input.rustup-target }} - - - name: Cache Dependencies - uses: Swatinem/rust-cache@v2 - - - run: cargo xtask --deny-warnings --platform ${{ matrix.input.platform }} --backend ${{ matrix.input.backend }} check # Clippy - # TODO: clippy esp32-c3 + # TODO: put in clippy-check-example once esp32-c3 clippy is fixed clippy: name: clippy runs-on: ubuntu-22.04 @@ -126,59 +121,6 @@ jobs: - run: cargo xtask --deny-warnings --platform ${{ matrix.input.platform }} --backend ${{ matrix.input.backend }} clippy - # Verify all examples, checks - checkexamples: - name: check examples - runs-on: ubuntu-22.04 - strategy: - matrix: - input: - - backend: thumbv7 - platform: lm3s6965 - rustup-target: thumbv7m-none-eabi - - - backend: thumbv6 - platform: lm3s6965 - rustup-target: thumbv6m-none-eabi - - - backend: thumbv8-base - platform: lm3s6965 - rustup-target: thumbv8m.base-none-eabi - - - backend: thumbv8-main - platform: lm3s6965 - rustup-target: thumbv8m.main-none-eabi - - - backend: riscv32-imc-clint - platform: hifive1 - rustup-target: riscv32imc-unknown-none-elf - - - backend: riscv32-imc-mecall - platform: hifive1 - rustup-target: riscv32imc-unknown-none-elf - - - backend: riscv-esp32-c3 - platform: esp32-c3 - rustup-target: riscv32imc-unknown-none-elf - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Configure Rust target ${{ matrix.input.rustup-target }} - run: rustup target add ${{ matrix.input.rustup-target }} - - - name: Cache Dependencies - uses: Swatinem/rust-cache@v2 - - - name: Check the examples - if: ${{ matrix.input.backend == 'thumbv8-base' }} - run: cargo xtask --platform ${{ matrix.input.platform }} --backend ${{ matrix.input.backend }} --exampleexclude pool example-check - - - name: Check the examples - if: ${{ matrix.input.backend != 'thumbv8-base' }} - run: cargo xtask --platform ${{ matrix.input.platform }} --backend ${{ matrix.input.backend }} example-check - buildqemu: name: Get modern QEMU, build and store runs-on: ubuntu-22.04 @@ -763,9 +705,7 @@ jobs: if: github.event_name == 'push' && success() needs: - formatcheck - - check - - clippy - - checkexamples + - check-clippy - testexamples - tests - docs diff --git a/.github/workflows/clippy-check-example.yml b/.github/workflows/clippy-check-example.yml new file mode 100644 index 0000000..5d44614 --- /dev/null +++ b/.github/workflows/clippy-check-example.yml @@ -0,0 +1,56 @@ +name: check-clippy-examples +on: + workflow_call: + inputs: + backend: + description: The backend to execute for + required: true + type: string + + platform: + description: The platform to execute for + required: true + type: string + + # TODO: get this from `cargo xtask`! + rustup-target: + description: The rustup target to install + required: true + type: string + + example-args: + description: Extra args to pass when checking examples + required: false + type: string + +jobs: + check: + runs-on: ubuntu-22.04 + name: Validate platform ${{ inputs.platform }}, backend ${{ inputs.backend }} + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Configure Rust target ${{ inputs.rustup-target }} + run: rustup target add ${{ inputs.rustup-target }} + + - name: Cache Dependencies + uses: Swatinem/rust-cache@v2 + + - run: cargo xtask --deny-warnings check -p ${{ inputs.platform }} -b ${{ inputs.backend }} + + check-examples: + runs-on: ubuntu-22.04 + name: Check examples + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Configure Rust target ${{ inputs.rustup-target }} + run: rustup target add ${{ inputs.rustup-target }} + + - name: Cache Dependencies + uses: Swatinem/rust-cache@v2 + + - name: Check the examples + run: cargo xtask example-check --platform ${{ inputs.platform }} --backend ${{ inputs.backend }} ${{ inputs.example-args }}
\ No newline at end of file |
