diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..6d81b54 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,80 @@ +name: CI + +on: + push: + pull_request: + +env: + # Used to differentiate from other slices of the cache for other workflow runs, and to forcefully bust the cache when renamed + CACHE_KEY_BASE: ci@v1 + +jobs: + setup: + name: Setup + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v5 + + - name: Set up Deno + uses: denoland/setup-deno@v2 + with: + deno-version: 2.x + cache-hash: ${{ env.CACHE_KEY_BASE }}-${{ hashFiles('deno.lock') }} + + - name: Install dependencies + run: deno install + + test: + name: Test + needs: [setup] + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v5 + + # Now the Deno cache should be warmed up, so this should be much faster + - name: Set up Deno + uses: denoland/setup-deno@v2 + with: + deno-version: 2.x + cache-hash: ${{ env.CACHE_KEY_BASE }}-${{ hashFiles('deno.lock') }} + + - name: Test + run: deno test --allow-read --no-prompt + + lint: + name: Lint + needs: [setup] + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v5 + + # Now the Deno cache should be warmed up, so this should be much faster + - name: Set up Deno + uses: denoland/setup-deno@v2 + with: + deno-version: 2.x + cache-hash: ${{ env.CACHE_KEY_BASE }}-${{ hashFiles('deno.lock') }} + + - name: Lint + run: deno run --allow-env --allow-run --no-prompt npm:@biomejs/biome ci + + check: + name: Check + needs: [setup] + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v5 + + # Now the Deno cache should be warmed up, so this should be much faster + - name: Set up Deno + uses: denoland/setup-deno@v2 + with: + deno-version: 2.x + cache-hash: ${{ env.CACHE_KEY_BASE }}-${{ hashFiles('deno.lock') }} + + - name: Lint + run: deno check diff --git a/deno.lock b/deno.lock index 025bcef..a563605 100644 --- a/deno.lock +++ b/deno.lock @@ -16,6 +16,7 @@ "jsr:@std/path@^1.1.1": "1.1.2", "jsr:@std/path@^1.1.2": "1.1.2", "jsr:@std/testing@*": "1.0.16", + "npm:@biomejs/biome@*": "2.2.6", "npm:@biomejs/biome@2.2.6": "2.2.6", "npm:@types/node@*": "24.2.0", "npm:chevrotain@^11.0.3": "11.0.3"