ci: pin actions by hash and use corepack (#21356)

This commit is contained in:
Daniel Roe 2023-06-05 19:24:32 +01:00 committed by GitHub
parent af9ee31b0d
commit 9deeab9b39
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 74 additions and 93 deletions

View File

@ -20,33 +20,23 @@ jobs:
node: [16] node: [16]
steps: steps:
- uses: actions/setup-node@v3 - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
with:
node-version: ${{ matrix.node }}
- name: checkout
uses: actions/checkout@v3
with: with:
fetch-depth: 0 # All history fetch-depth: 0 # All history
- run: corepack enable
- uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
with:
node-version: ${{ matrix.node }}
cache: "yarn"
- name: fetch tags - name: fetch tags
run: git fetch --depth=1 origin "+refs/tags/*:refs/tags/*" run: git fetch --depth=1 origin "+refs/tags/*:refs/tags/*"
- name: cache node_modules
id: node_modules_cache_id
uses: actions/cache@v3
with:
path: |
node_modules
packages/*/node_modules
distributions/*/node_modules
key: ${{ matrix.os }}-node-v${{ matrix.node }}-deps-${{ hashFiles(format('{0}{1}', github.workspace, '/yarn.lock')) }}
- name: install - name: install
run: yarn --check-files --frozen-lockfile --non-interactive run: yarn --check-files --frozen-lockfile --non-interactive
- name: cache workspace - name: cache workspace
uses: actions/cache@v3 uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
with: with:
path: | path: |
node_modules node_modules
@ -64,15 +54,15 @@ jobs:
node: [16] node: [16]
steps: steps:
- uses: actions/setup-node@v3 - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- run: corepack enable
- uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
with: with:
node-version: ${{ matrix.node }} node-version: ${{ matrix.node }}
cache: "yarn"
- name: checkout
uses: actions/checkout@master
- name: restore workspace cache - name: restore workspace cache
uses: actions/cache@v3 uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
with: with:
path: | path: |
node_modules node_modules
@ -97,15 +87,15 @@ jobs:
node: [16] node: [16]
steps: steps:
- uses: actions/setup-node@v3 - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- run: corepack enable
- uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
with: with:
node-version: ${{ matrix.node }} node-version: ${{ matrix.node }}
cache: "yarn"
- name: checkout
uses: actions/checkout@master
- name: restore workspace cache - name: restore workspace cache
uses: actions/cache@v3 uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
with: with:
path: | path: |
node_modules node_modules
@ -128,15 +118,15 @@ jobs:
node: [16] node: [16]
steps: steps:
- uses: actions/setup-node@v3 - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- run: corepack enable
- uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
with: with:
node-version: ${{ matrix.node }} node-version: ${{ matrix.node }}
cache: "yarn"
- name: checkout
uses: actions/checkout@master
- name: restore workspace cache - name: restore workspace cache
uses: actions/cache@v3 uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
with: with:
path: | path: |
node_modules node_modules
@ -168,15 +158,15 @@ jobs:
NODE_OPTIONS: "--max_old_space_size=4096" NODE_OPTIONS: "--max_old_space_size=4096"
steps: steps:
- uses: actions/setup-node@v3 - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- run: corepack enable
- uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
with: with:
node-version: ${{ matrix.node }} node-version: ${{ matrix.node }}
cache: "yarn"
- name: checkout
uses: actions/checkout@master
- name: restore workspace cache - name: restore workspace cache
uses: actions/cache@v3 uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
with: with:
path: | path: |
node_modules node_modules
@ -189,7 +179,7 @@ jobs:
run: yarn test:fixtures -i run: yarn test:fixtures -i
- name: Save fixtures - name: Save fixtures
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
with: with:
name: fixtures-${{ matrix.os }}-node-v${{ matrix.node }} name: fixtures-${{ matrix.os }}-node-v${{ matrix.node }}
path: test/fixtures path: test/fixtures
@ -204,15 +194,15 @@ jobs:
node: [16] node: [16]
steps: steps:
- uses: actions/setup-node@v3 - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- run: corepack enable
- uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
with: with:
node-version: ${{ matrix.node }} node-version: ${{ matrix.node }}
cache: "yarn"
- name: checkout
uses: actions/checkout@master
- name: restore workspace cache - name: restore workspace cache
uses: actions/cache@v3 uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
with: with:
path: | path: |
node_modules node_modules
@ -222,7 +212,7 @@ jobs:
key: ${{ matrix.os }}-node-v${{ matrix.node }}-nuxt-${{ github.sha }} key: ${{ matrix.os }}-node-v${{ matrix.node }}-nuxt-${{ github.sha }}
- name: restore fixtures - name: restore fixtures
uses: actions/download-artifact@v3 uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
with: with:
name: fixtures-${{ matrix.os }}-node-v${{ matrix.node }} name: fixtures-${{ matrix.os }}-node-v${{ matrix.node }}
path: test/fixtures path: test/fixtures
@ -241,15 +231,15 @@ jobs:
node: [16] node: [16]
steps: steps:
- uses: actions/setup-node@v3 - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- run: corepack enable
- uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
with: with:
node-version: ${{ matrix.node }} node-version: ${{ matrix.node }}
cache: "yarn"
- name: checkout
uses: actions/checkout@master
- name: restore workspace cache - name: restore workspace cache
uses: actions/cache@v3 uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
with: with:
path: | path: |
node_modules node_modules
@ -259,7 +249,7 @@ jobs:
key: ${{ matrix.os }}-node-v${{ matrix.node }}-nuxt-${{ github.sha }} key: ${{ matrix.os }}-node-v${{ matrix.node }}-nuxt-${{ github.sha }}
- name: restore fixtures - name: restore fixtures
uses: actions/download-artifact@v3 uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
with: with:
name: fixtures-${{ matrix.os }}-node-v${{ matrix.node }} name: fixtures-${{ matrix.os }}-node-v${{ matrix.node }}
path: test/fixtures path: test/fixtures
@ -278,15 +268,15 @@ jobs:
node: [16] node: [16]
steps: steps:
- uses: actions/setup-node@v3 - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- run: corepack enable
- uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
with: with:
node-version: ${{ matrix.node }} node-version: ${{ matrix.node }}
cache: "yarn"
- name: checkout
uses: actions/checkout@master
- name: restore workspace cache - name: restore workspace cache
uses: actions/cache@v3 uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
with: with:
path: | path: |
node_modules node_modules
@ -296,7 +286,7 @@ jobs:
key: ${{ matrix.os }}-node-v${{ matrix.node }}-nuxt-${{ github.sha }} key: ${{ matrix.os }}-node-v${{ matrix.node }}-nuxt-${{ github.sha }}
- name: restore fixtures - name: restore fixtures
uses: actions/download-artifact@v3 uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
with: with:
name: fixtures-${{ matrix.os }}-node-v${{ matrix.node }} name: fixtures-${{ matrix.os }}-node-v${{ matrix.node }}
path: test/fixtures path: test/fixtures
@ -314,8 +304,7 @@ jobs:
node: [16] node: [16]
steps: steps:
- name: checkout - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
uses: actions/checkout@master
with: with:
ref: "refs/heads/dev" ref: "refs/heads/dev"
fetch-depth: 0 # All history fetch-depth: 0 # All history
@ -324,7 +313,7 @@ jobs:
run: git fetch --depth=1 origin "+refs/tags/*:refs/tags/*" run: git fetch --depth=1 origin "+refs/tags/*:refs/tags/*"
- name: restore workspace cache - name: restore workspace cache
uses: actions/cache@v3 uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
with: with:
path: | path: |
node_modules node_modules
@ -333,9 +322,10 @@ jobs:
packages/*/dist packages/*/dist
key: ${{ matrix.os }}-node-v${{ matrix.node }}-nuxt-${{ github.sha }} key: ${{ matrix.os }}-node-v${{ matrix.node }}-nuxt-${{ github.sha }}
- uses: actions/setup-node@v3 - uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
with: with:
node-version: ${{ matrix.node }} node-version: ${{ matrix.node }}
cache: "yarn"
registry-url: "https://registry.npmjs.org" registry-url: "https://registry.npmjs.org"
- name: bump version - name: bump version

View File

@ -19,28 +19,18 @@ jobs:
node: [16] node: [16]
steps: steps:
- uses: actions/setup-node@v3 - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- run: corepack enable
- uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
with: with:
node-version: ${{ matrix.node }} node-version: ${{ matrix.node }}
cache: "yarn"
- name: checkout
uses: actions/checkout@v3
- name: cache node_modules
id: node_modules_cache_id
uses: actions/cache@v3
with:
path: |
node_modules
packages/*/node_modules
distributions/*/node_modules
key: ${{ matrix.os }}-node-v${{ matrix.node }}-deps-${{ hashFiles(format('{0}{1}', github.workspace, '/yarn.lock')) }}-2
- name: install - name: install
run: yarn --check-files --frozen-lockfile --non-interactive run: yarn --check-files --frozen-lockfile --non-interactive
- name: cache workspace - name: cache workspace
uses: actions/cache@v3 uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
with: with:
path: | path: |
node_modules node_modules
@ -61,15 +51,15 @@ jobs:
NODE_OPTIONS: "--max_old_space_size=4096" NODE_OPTIONS: "--max_old_space_size=4096"
steps: steps:
- uses: actions/setup-node@v3 - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- run: corepack enable
- uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
with: with:
node-version: ${{ matrix.node }} node-version: ${{ matrix.node }}
cache: "yarn"
- name: checkout
uses: actions/checkout@master
- name: restore workspace cache - name: restore workspace cache
uses: actions/cache@v3 uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
with: with:
path: | path: |
node_modules node_modules
@ -95,15 +85,15 @@ jobs:
NODE_OPTIONS: "--max_old_space_size=4096" NODE_OPTIONS: "--max_old_space_size=4096"
steps: steps:
- uses: actions/setup-node@v3 - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- run: corepack enable
- uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
with: with:
node-version: ${{ matrix.node }} node-version: ${{ matrix.node }}
cache: "yarn"
- name: checkout
uses: actions/checkout@master
- name: restore workspace cache - name: restore workspace cache
uses: actions/cache@v3 uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
with: with:
path: | path: |
node_modules node_modules
@ -116,7 +106,7 @@ jobs:
run: yarn test:fixtures run: yarn test:fixtures
- name: Save fixtures - name: Save fixtures
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
with: with:
name: fixtures-${{ matrix.os }}-node-v${{ matrix.node }} name: fixtures-${{ matrix.os }}-node-v${{ matrix.node }}
path: test/fixtures path: test/fixtures
@ -134,15 +124,15 @@ jobs:
NODE_OPTIONS: "--max_old_space_size=4096" NODE_OPTIONS: "--max_old_space_size=4096"
steps: steps:
- uses: actions/setup-node@v3 - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- run: corepack enable
- uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
with: with:
node-version: ${{ matrix.node }} node-version: ${{ matrix.node }}
cache: "yarn"
- name: checkout
uses: actions/checkout@master
- name: restore workspace cache - name: restore workspace cache
uses: actions/cache@v3 uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
with: with:
path: | path: |
node_modules node_modules
@ -152,7 +142,7 @@ jobs:
key: ${{ matrix.os }}-node-v${{ matrix.node }}-nuxt-${{ github.sha }} key: ${{ matrix.os }}-node-v${{ matrix.node }}-nuxt-${{ github.sha }}
- name: restore fixtures - name: restore fixtures
uses: actions/download-artifact@v3 uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
with: with:
name: fixtures-${{ matrix.os }}-node-v${{ matrix.node }} name: fixtures-${{ matrix.os }}-node-v${{ matrix.node }}
path: test/fixtures path: test/fixtures

View File

@ -87,5 +87,6 @@
"sort-package-json": "2.4.1", "sort-package-json": "2.4.1",
"typescript": "5.1.3", "typescript": "5.1.3",
"vue-jest": "4.0.1" "vue-jest": "4.0.1"
} },
"packageManager": "yarn@1.22.19"
} }