From 8f4b619f75e59d715280ed3d0b495f3815e07e5a Mon Sep 17 00:00:00 2001 From: dirkluijk Date: Thu, 21 Nov 2024 01:49:03 +0100 Subject: [PATCH] ci: CI on both Node 22 and Deno 2 --- .github/workflows/ci.yml | 27 +++++++++++++++------------ .github/workflows/docs.yml | 3 +-- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 27fb68f..db53f52 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,11 +7,11 @@ jobs: name: "Build" strategy: matrix: - runtime: [ 'Node.js v22' ] + runtime: [ 'Node.js' ] + version: [20, 22, 23] runs-on: ubuntu-latest - steps: - name: 'Clone repository' uses: actions/checkout@v4 @@ -19,7 +19,7 @@ jobs: - name: 'Install Node.js' uses: actions/setup-node@v4 with: - node-version: '22' + node-version: ${{ matrix.version }} cache: 'npm' - name: 'npm ci' @@ -48,16 +48,13 @@ jobs: name: "Build" strategy: matrix: - runtime: [ 'Deno v2' ] + runtime: [ 'Deno' ] + version: ['v2.x'] runs-on: ubuntu-latest - permissions: - id-token: write # Needed for auth with Deno Deploy - contents: read # Needed to clone the repository - env: - DENO_DIR: '.deno' + DENO_DIR: '/tmp/.deno' steps: - name: 'Clone repository' @@ -66,13 +63,19 @@ jobs: - name: 'Install Deno' uses: denoland/setup-deno@v2 with: - deno-version: v2.x + deno-version: ${{ matrix.version }} + + - name: 'restore .deno dir' + uses: actions/cache/restore@v4 + with: + path: ${{ env.DENO_DIR }} + key: deno_dir - name: 'deno install' run: deno install - - name: 'cache Deno dir' - uses: actions/cache@v2 + - name: 'cache .deno dir' + uses: actions/cache/save@v4 with: path: ${{ env.DENO_DIR }} key: deno_dir diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 00cb3c5..23876a3 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -35,7 +35,7 @@ jobs: uses: actions/setup-node@v4 with: node-version: 22 - cache: npm + cache: 'npm' - name: 'Setup Pages' uses: actions/configure-pages@v4 @@ -63,5 +63,4 @@ jobs: steps: - name: 'Deploy to GitHub Pages' - id: deployment uses: actions/deploy-pages@v4