From 605aa840e11ec7d1eb16f21d579ce4bdb1dbb008 Mon Sep 17 00:00:00 2001 From: Jason Siefken Date: Sat, 13 Jan 2024 15:41:22 -0500 Subject: [PATCH] Add Github Actions CI (#2) Add CI via Github Actions --- .github/workflows/on-pull-request.yml | 77 +++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 .github/workflows/on-pull-request.yml diff --git a/.github/workflows/on-pull-request.yml b/.github/workflows/on-pull-request.yml new file mode 100644 index 0000000..43da5a7 --- /dev/null +++ b/.github/workflows/on-pull-request.yml @@ -0,0 +1,77 @@ +name: Build and Test + +on: + push: + branches: [main, next] + pull_request: + branches: ["*"] + +jobs: + build: + name: Build + runs-on: ubuntu-latest + + steps: + - name: Checkout sources + uses: actions/checkout@v3 + + - name: Install toolchain + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + + - name: Check + uses: actions-rs/cargo@v1 + with: + command: check + + - name: Build + uses: actions-rs/cargo@v1 + with: + command: build + test: + name: Test + runs-on: ubuntu-latest + + steps: + - name: Checkout sources + uses: actions/checkout@v3 + + - name: Install toolchain + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + components: rustfmt + + - name: Add cargo-expand + run: cargo install cargo-expand + + - name: Test + uses: actions-rs/cargo@v1 + with: + command: test + lint: + name: Lint + runs-on: ubuntu-latest + + steps: + - name: Checkout sources + uses: actions/checkout@v3 + + - name: Install toolchain + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + components: rustfmt, clippy + + - name: Cargo fmt + uses: actions-rs/cargo@v1 + with: + command: fmt + args: --all -- --check