From 6ffba9296f4e2915b0dec8c548f450825d04933e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phan=20Kochen?= Date: Sun, 29 Oct 2023 21:33:20 +0100 Subject: [PATCH] Test multiple Yarn versions in CI --- .github/workflows/build.yml | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 680467e..fad8087 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,6 +11,9 @@ jobs: runs-on: ubuntu-latest permissions: contents: write + strategy: + matrix: + yarn_version: [3, 4] env: NIX_PATH: nixpkgs=channel:nixpkgs-unstable steps: @@ -25,24 +28,18 @@ jobs: - name: Enable corepack run: corepack enable - - name: Yarn cache - uses: actions/cache@v3 - with: - path: .yarn/cache - key: yarn-${{ hashFiles('yarn.lock') }} - restore-keys: yarn- - - name: Yarn install - run: yarn install --immutable + run: yarn - name: TypeScript + if: matrix.yarn_version == 4 run: yarn check - name: Build run: yarn build - name: Update dist - if: github.repository_owner == 'stephank' && github.ref == 'refs/heads/main' + if: matrix.yarn_version == 4 && github.repository_owner == 'stephank' && github.ref == 'refs/heads/main' run: | if [[ "$(git status --porcelain)" != "" ]]; then git config user.email "41898282+github-actions[bot]@users.noreply.github.com" @@ -51,24 +48,20 @@ jobs: git push fi + - name: Set Yarn version + run: yarn set version ${{ matrix.yarn_version }} + - name: Install plugin run: yarn plugin import ./dist/yarn-plugin-nixify.js - name: Test without Nix - run: yarn + run: yarn --no-immutable - name: Install Nix uses: cachix/install-nix-action@v23 with: nix_path: nixpkgs=channel:nixos-unstable - - name: Setup Cachix - if: github.event_name == 'push' && github.repository_owner == 'stephank' - uses: cachix/cachix-action@v12 - with: - name: stephank - signingKey: "${{ secrets.CACHIX_SIGNING_KEY }}" - - name: Add bin run: | cat > hello.js << EOF