From 41c52541a5930806ff2ec748c9ee01f6b06e439b Mon Sep 17 00:00:00 2001 From: Victor Fernandez de Alba Date: Wed, 20 Mar 2024 21:22:18 +0100 Subject: [PATCH] Fix CI --- .github/workflows/acceptance.yml | 40 ++++++++++++++++++++++++++------ .github/workflows/changelog.yml | 2 +- .github/workflows/code.yml | 28 +++++++++++++++++++++- .github/workflows/unit.yml | 28 +++++++++++++++++++++- 4 files changed, 88 insertions(+), 10 deletions(-) diff --git a/.github/workflows/acceptance.yml b/.github/workflows/acceptance.yml index 566234b..01fc907 100644 --- a/.github/workflows/acceptance.yml +++ b/.github/workflows/acceptance.yml @@ -10,17 +10,43 @@ jobs: acceptance: runs-on: ubuntu-latest + matrix: + node-version: [18.x, 20.x] steps: - - name: Checkout - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + + - uses: pnpm/action-setup@v3 + name: Install pnpm + with: + version: 8 + # We don't want to install until later, + # when the cache and Cypress are in place + run_install: false - - name: Install Cypress + - name: Get pnpm store directory + shell: bash run: | - cd acceptance - yarn + echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV + + - uses: actions/cache@v4 + name: Setup pnpm cache + with: + path: ${{ env.STORE_PATH }} + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-pnpm-store- + + - name: Cache Cypress Binary + id: cache-cypress-binary + uses: actions/cache@v4 + with: + path: ~/.cache/Cypress + key: binary-${{ matrix.node-version }}-${{ hashFiles('pnpm-lock.yaml') }} - name: "Cypress: Acceptance tests" uses: cypress-io/github-action@v5 diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml index aa751e2..e76851e 100644 --- a/.github/workflows/changelog.yml +++ b/.github/workflows/changelog.yml @@ -12,7 +12,7 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: # Fetch all history fetch-depth: '0' diff --git a/.github/workflows/code.yml b/.github/workflows/code.yml index 0db938c..11e39b6 100644 --- a/.github/workflows/code.yml +++ b/.github/workflows/code.yml @@ -9,7 +9,33 @@ jobs: steps: - name: Main checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 + + - name: Use Node.js 20.x + uses: actions/setup-node@v4 + with: + node-version: 20.x + + - uses: pnpm/action-setup@v3 + name: Install pnpm + with: + version: 8 + # We don't want to install until later, + # when the cache and Cypress are in place + run_install: false + + - name: Get pnpm store directory + shell: bash + run: | + echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV + + - uses: actions/cache@v4 + name: Setup pnpm cache + with: + path: ${{ env.STORE_PATH }} + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-pnpm-store- - name: Linting run: make lint diff --git a/.github/workflows/unit.yml b/.github/workflows/unit.yml index 8dbb3de..aa0949c 100644 --- a/.github/workflows/unit.yml +++ b/.github/workflows/unit.yml @@ -9,7 +9,33 @@ jobs: steps: - name: Main checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 + + - name: Use Node.js 20.x + uses: actions/setup-node@v4 + with: + node-version: 20.x + + - uses: pnpm/action-setup@v3 + name: Install pnpm + with: + version: 8 + # We don't want to install until later, + # when the cache and Cypress are in place + run_install: false + + - name: Get pnpm store directory + shell: bash + run: | + echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV + + - uses: actions/cache@v4 + name: Setup pnpm cache + with: + path: ${{ env.STORE_PATH }} + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-pnpm-store- - name: Unit tests run: make test-ci