From 73054ea2e5aebcb9b3c76e95c4fbbb4063330213 Mon Sep 17 00:00:00 2001 From: Kyle Davis Date: Mon, 18 Mar 2024 19:32:32 -0700 Subject: [PATCH] feat: setup github workflows (#1) * feat: setup github workflows * feat: setup github workflows --- .github/workflows/ci.yml | 86 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..7b710f3 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,86 @@ +name: CI + +on: + push: + branches: [main] + pull_request: + branches: [main] + +# Clippy action needs the write permission. +permissions: + checks: write + +jobs: + format: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - uses: actions-rs/toolchain@v1 + with: + toolchain: nightly + components: rustfmt + + - uses: actions-rs/cargo@v1 + with: + command: fmt + args: --check + + - name: Setup pnpm + uses: pnpm/action-setup@v2.2.4 + + - name: Setup node + uses: actions/setup-node@v3 + with: + node-version-file: ".nvmrc" + + - run: pnpm install --frozen-lockfile + - name: Run prettier + run: |- + pnpm format:check + + lint: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - uses: actions-rs/toolchain@v1 + with: + toolchain: nightly + components: clippy + + - uses: actions-rs/clippy-check@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + args: --all-features + + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - uses: actions-rs/toolchain@v1 + with: + toolchain: nightly + + - uses: actions-rs/cargo@v1 + with: + command: build + args: --release --all-features + + test: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - uses: actions-rs/toolchain@v1 + with: + toolchain: nightly + + - uses: actions-rs/cargo@v1 + with: + command: test