From f30c66ad218eacea5c7ff09cfbfb0bdfdf02da53 Mon Sep 17 00:00:00 2001 From: Felipe Lima Date: Tue, 19 Nov 2024 14:29:09 -0800 Subject: [PATCH 1/2] chore(ci): Run CI on node test matrix --- .github/workflows/lint-test-sdk.yml | 31 +++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/.github/workflows/lint-test-sdk.yml b/.github/workflows/lint-test-sdk.yml index 77ec722..7b72da4 100644 --- a/.github/workflows/lint-test-sdk.yml +++ b/.github/workflows/lint-test-sdk.yml @@ -7,16 +7,25 @@ on: jobs: lint-test-sdk: runs-on: ubuntu-latest + strategy: + matrix: + node-version: [ '18', '20', '22', '23' ] steps: - uses: actions/checkout@v3 - name: Use Node.js uses: actions/setup-node@v3 with: - node-version: '18.x' - - uses: actions/cache@v2 + node-version: ${{ matrix.node-version }} + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT + - uses: actions/cache@v4 + id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) with: - path: './node_modules' - key: ${{ runner.os }}-root-node-modules-${{ hashFiles('./yarn.lock') }} + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- - name: 'Set up GCP SDK for downloading test data' uses: 'google-github-actions/setup-gcloud@v0' - name: Install SDK dependencies @@ -35,11 +44,17 @@ jobs: - name: Use Node.js uses: actions/setup-node@v3 with: - node-version: '18.x' - - uses: actions/cache@v2 + node-version: ${{ matrix.node-version }} + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT + - uses: actions/cache@v4 + id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) with: - path: './node_modules' - key: ${{ runner.os }}-root-node-modules-${{ hashFiles('./yarn.lock') }} + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- - name: Install SDK dependencies run: yarn --frozen-lockfile working-directory: ./ From 97737c30b30586d3aa68c78a070ef70ec39f3417 Mon Sep 17 00:00:00 2001 From: Felipe Lima Date: Tue, 19 Nov 2024 14:30:57 -0800 Subject: [PATCH 2/2] add missing matrix --- .github/workflows/lint-test-sdk.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/lint-test-sdk.yml b/.github/workflows/lint-test-sdk.yml index 7b72da4..2c3fa11 100644 --- a/.github/workflows/lint-test-sdk.yml +++ b/.github/workflows/lint-test-sdk.yml @@ -39,6 +39,9 @@ jobs: working-directory: ./ typecheck: runs-on: ubuntu-latest + strategy: + matrix: + node-version: [ '18', '20', '22', '23' ] steps: - uses: actions/checkout@v3 - name: Use Node.js