From b0f91b2b0fd2b2be658854f164a8e3407ae44215 Mon Sep 17 00:00:00 2001 From: Travis Collins Date: Mon, 15 Jan 2024 23:27:48 -0800 Subject: [PATCH] Add CI workflow + funding file. --- .github/FUNDING.yml | 3 ++ .github/workflows/ci.yml | 79 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 82 insertions(+) create mode 100644 .github/FUNDING.yml create mode 100644 .github/workflows/ci.yml diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..b8606a4 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,3 @@ +github: ShieldBattery +ko_fi: tec27 +patreon: tec27 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..e26369c --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,79 @@ +name: CI + +on: [push, pull_request] + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + clippy: + runs-on: windows-latest + defaults: + run: + working-directory: ./native + strategy: + fail-fast: false + steps: + - uses: actions/checkout@v3 + + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@stable + with: + components: clippy + + - uses: Swatinem/rust-cache@v2 + with: + workspaces: ./native + + - name: clippy + run: cargo clippy --all-targets --workspace -- -D warnings + + fmt: + runs-on: windows-latest + defaults: + run: + working-directory: ./native + strategy: + fail-fast: false + steps: + - uses: actions/checkout@v3 + + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@stable + with: + components: rustfmt + + - name: rustfmt + run: cargo fmt --all -- --check + + test: + runs-on: windows-latest + strategy: + fail-fast: false + steps: + - uses: actions/checkout@v3 + + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@stable + + - uses: Swatinem/rust-cache@v2 + with: + workspaces: ./native + + - name: Using pnpm v8.x + uses: pnpm/action-setup@v2 + with: + version: 8 + + - name: Using Node.js 20.x + uses: actions/setup-node@v3 + with: + node-version: '20.x' + cache: 'pnpm' + + - name: Install JS dependencies + run: pnpm install --frozen-lockfile + + - name: Tests + run: pnpm test