diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..0f12243 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,49 @@ +name: CI + +on: [push,pull_request] + +env: + CARGO_TERM_COLOR: always + # By default, RUSTFLAGS with “-D warnings” turns “asm_const” warnings into errors. + RUSTFLAGS: + +jobs: + fmt: + name: Rustfmt all packages + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions-rust-lang/setup-rust-toolchain@v1 + with: + components: rustfmt + - name: Rustfmt Check + uses: actions-rust-lang/rustfmt@v1 + + build-allwinner-rt: + name: Build allwinner-rt + needs: fmt + runs-on: ubuntu-latest + strategy: + matrix: + TARGET: [riscv64imac-unknown-none-elf] + TOOLCHAIN: [nightly] + steps: + - uses: actions/checkout@v4 + - uses: actions-rust-lang/setup-rust-toolchain@v1 + with: + target: ${{ MATRIX.TARGET }} + toolchain: ${{ MATRIX.TOOLCHAIN }} + - name: Run build + run: cargo build -p allwinner-rt --target ${{ MATRIX.TARGET }} + + test-allwinner-hal: + name: Test allwinner-hal + needs: fmt + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions-rust-lang/setup-rust-toolchain@v1 + with: + toolchain: stable + - name: Run tests + run: cargo test \ No newline at end of file diff --git a/.github/workflows/fmt-and-test.yml b/.github/workflows/fmt-and-test.yml deleted file mode 100644 index 1bd3107..0000000 --- a/.github/workflows/fmt-and-test.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: fmt-and-test - -on: [push,pull_request] - -jobs: - fmt-and-test: - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Check format - run: cargo fmt --check - - - name: Run test - if: ${{ success() }} - run: cargo test \ No newline at end of file