Add axplat-cli to generate platform package template #17
This file contains 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, pull_request] | |
jobs: | |
ci: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
rust-toolchain: [nightly] | |
targets: [x86_64-unknown-linux-gnu, x86_64-unknown-none, riscv64gc-unknown-none-elf, aarch64-unknown-none] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@nightly | |
with: | |
toolchain: ${{ matrix.rust-toolchain }} | |
components: rust-src, clippy, rustfmt | |
targets: ${{ matrix.targets }} | |
- name: Check rust version | |
run: rustc --version --verbose | |
- name: Check code format | |
run: cargo fmt --all -- --check | |
- name: Clippy | |
run: cargo clippy --target ${{ matrix.targets }} --all-features --workspace --exclude axplat-cli | |
- name: Build | |
run: cargo build --target ${{ matrix.targets }} --all-features --workspace --exclude axplat-cli | |
- name: Unit test | |
if: ${{ matrix.targets == 'x86_64-unknown-linux-gnu' }} | |
run: cargo test --target ${{ matrix.targets }} -- --nocapture | |
cli: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@nightly | |
with: | |
components: rust-src, clippy | |
- name: Clippy | |
run: cargo clippy -p axplat-cli | |
- name: Build | |
run: cargo build -p axplat-cli | |
doc: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
permissions: | |
contents: write | |
env: | |
default-branch: ${{ format('refs/heads/{0}', github.event.repository.default_branch) }} | |
RUSTDOCFLAGS: -Zunstable-options --enable-index-page -D rustdoc::broken_intra_doc_links -D missing-docs | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@nightly | |
- name: Build docs | |
continue-on-error: ${{ github.ref != env.default-branch && github.event_name != 'pull_request' }} | |
run: cargo doc --no-deps --all-features | |
- name: Deploy to Github Pages | |
if: ${{ github.ref == env.default-branch }} | |
uses: JamesIves/github-pages-deploy-action@v4 | |
with: | |
single-commit: true | |
branch: gh-pages | |
folder: target/doc |