feat(hal): implement GTC instance and refactor code structure #15
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: Cargo CI | |
| on: [push, pull_request] | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| fmt: | |
| name: Rustfmt Check | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| toolchain: stable | |
| components: rustfmt | |
| - name: Run cargo fmt | |
| run: cargo fmt --all -- --check | |
| test-hal: | |
| name: Test artinchip-hal | |
| needs: fmt | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| FEATURES: [d12x, d13x, d21x, g73x, m6800] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| toolchain: stable | |
| - name: Run cargo test | |
| run: cargo test -p artinchip-hal --features ${{ matrix.FEATURES }} | |
| test-aicfwc: | |
| name: Test aicfwc | |
| needs: fmt | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| toolchain: stable | |
| - name: Run cargo test | |
| run: cargo test -p aicfwc --all-features | |
| test-hal-coverage: | |
| name: Test artinchip-hal Coverage | |
| needs: fmt | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| toolchain: stable | |
| - name: Install cargo-tarpaulin | |
| run: cargo install cargo-tarpaulin | |
| - name: Generate code coverage | |
| run: cargo tarpaulin --engine llvm -p artinchip-hal --all-features --out Html --output-dir ./coverage-report | |
| - name: Upload coverage report | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage-report-html | |
| path: ./coverage-report/ | |
| clippy: | |
| name: Clippy Check | |
| needs: fmt | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| PACKAGE: [artinchip-hal, artinchip-rt, aicfwc] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| toolchain: stable | |
| components: clippy | |
| - name: Run cargo clippy | |
| run: cargo clippy -p ${{ matrix.PACKAGE }} --all-targets --all-features -- -D warnings | |
| audit: | |
| name: Security Audit | |
| needs: fmt | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| toolchain: stable | |
| - name: Install cargo-audit | |
| run: cargo install cargo-audit | |
| - name: Run cargo audit | |
| run: cargo audit | |
| build-rv32-examples: | |
| name: Build Examples for RV32 | |
| needs: fmt | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| FEATURES: [d13x] | |
| EXAMPLES: [pbp-blinky, pbp-hello-world] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| toolchain: nightly | |
| target: riscv32imac-unknown-none-elf | |
| - name: Build examples | |
| run: cargo build -p ${{ matrix.EXAMPLES }} --target riscv32imac-unknown-none-elf --release --features ${{ matrix.FEATURES }} |