From 193b76ed601c1e0717589f19b977ed27e04f6465 Mon Sep 17 00:00:00 2001 From: Fintan Halpenny Date: Thu, 20 Jan 2022 11:41:59 +0000 Subject: [PATCH] ci: github actions Add github actions to run the ci scripts for github PRs. Signed-off-by: Fintan Halpenny --- .github/workflows/ci.yaml | 97 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 .github/workflows/ci.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..d2ee508 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,97 @@ +name: ci +on: [push, pull_request] +jobs: + fmt: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: nightly + components: rustfmt + - uses: Swatinem/rust-cache@v1 + - run: ./ci/fmt + shell: bash + + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + components: clippy + - uses: Swatinem/rust-cache@v1 + - run: ./ci/lint + shell: bash + + docs: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + - uses: Swatinem/rust-cache@v1 + - run: ./ci/docs + shell: bash + + cargo-deny: + runs-on: ubuntu-latest + strategy: + matrix: + checks: + - advisories + - bans licenses sources + continue-on-error: ${{ matrix.checks == 'advisories' }} + steps: + - uses: actions/checkout@v2 + - uses: EmbarkStudios/cargo-deny-action@v1 + with: + command: check ${{ matrix.checks }} + + linux: + runs-on: ubuntu-latest + strategy: + matrix: + toolchain: + - stable + - nightly + continue-on-error: ${{ matrix.toolchain == 'nightly' }} + steps: + - uses: actions/checkout@master + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: ${{ matrix.toolchain }} + - uses: Swatinem/rust-cache@v1 + - run: ./ci/gh/build-test + shell: bash + + macos: + runs-on: macos-latest + steps: + - uses: actions/checkout@master + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + - uses: Swatinem/rust-cache@v1 + - run: ./ci/gh/build-test + shell: bash + + windows: + runs-on: windows-latest + continue-on-error: true + steps: + - uses: actions/checkout@master + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + - uses: Swatinem/rust-cache@v1 + - run: ./ci/gh/build-test + shell: bash