feat: setup github workflows (#1)

* feat: setup github workflows

* feat: setup github workflows
This commit is contained in:
Kyle Davis 2024-03-18 19:32:32 -07:00 committed by GitHub
parent 0f65ecc1d3
commit 73054ea2e5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

86
.github/workflows/ci.yml vendored Normal file
View file

@ -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