Skip to content

Commit

Permalink
chore: fix workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
danez committed Jan 11, 2023
1 parent 64b6b0e commit e22c931
Show file tree
Hide file tree
Showing 11 changed files with 16 additions and 26 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,8 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '*'
cache: 'npm'
cache-dependency-path: 'npm-shrinkwrap.json'
check-latest: true
node-version: lts/*
cache: npm
- name: Install dependencies
run: npm ci --no-audit && npm prune --production
- name: Get size
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,13 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
cache-dependency-path: 'npm-shrinkwrap.json'
cache: npm
check-latest: true
- name: Cache verdaccio storage
uses: actions/cache@v3
with:
path: ./.verdaccio-storage
key: verdaccio-e2e-cli-${{ hashFiles('./npm-shrinkwrap.json') }}
key: verdaccio-e2e-cli-${{ hashFiles('./package-lock.json') }}
- name: Install dependencies
run: npm ci --no-audit
- name: Install pnpm
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
cache-dependency-path: 'npm-shrinkwrap.json'
cache: npm
check-latest: true
if: '${{!steps.release-check.outputs.IS_RELEASE}}'
- name: Setup Deno
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/legacy-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
cache-dependency-path: 'npm-shrinkwrap.json'
cache: npm
check-latest: true
if: '${{!steps.release-check.outputs.IS_RELEASE}}'
- name: Setup Deno
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '*'
cache: 'npm'
check-latest: true
cache-dependency-path: 'npm-shrinkwrap.json'
node-version: lts/*
cache: npm
registry-url: 'https://registry.npmjs.org'
- name: Install core dependencies
run: npm ci --no-audit
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
cache-dependency-path: 'npm-shrinkwrap.json'
cache: npm
check-latest: true
if: '${{!steps.release-check.outputs.IS_RELEASE}}'
- name: Install core dependencies
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/verify-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,8 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '*'
cache: 'npm'
cache-dependency-path: 'npm-shrinkwrap.json'
check-latest: true
node-version: lts/*
cache: npm
- name: Install core dependencies
run: npm ci --no-audit
- name: Install site dependencies
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
},
"config": {
"eslint": "--ignore-path .gitignore --cache --format=codeframe --max-warnings=0 \"{src,scripts,site,tests,.github}/**/*.{mjs,cjs,js,md,html}\" \"*.{mjs,cjs,js,md,html}\" \".*.{mjs,cjs,js,md,html}\"",
"prettier": "--ignore-path .gitignore --loglevel=warn \"{src,tools,scripts,site,tests,.github}/**/*.{mjs,cjs,js,md,yml,json,html}\" \"*.{mjs,cjs,js,yml,json,html}\" \".*.{mjs,cjs,js,yml,json,html}\" \"!CHANGELOG.md\" \"!npm-shrinkwrap.json\" \"!**/*/package-lock.json\" \"!.github/**/*.md\""
"prettier": "--ignore-path .gitignore --loglevel=warn \"{src,tools,scripts,site,tests,.github}/**/*.{mjs,cjs,js,md,yml,json,html}\" \"*.{mjs,cjs,js,yml,json,html}\" \".*.{mjs,cjs,js,yml,json,html}\" \"!CHANGELOG.md\" \"!**/*/package-lock.json\" \"!.github/**/*.md\""
},
"dependencies": {
"@fastify/static": "^6.6.0",
Expand Down
2 changes: 1 addition & 1 deletion tools/affected-test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export const getAffectedFiles = (changedFiles) => {

// in this case all files are affected
if (
changedFiles.includes('npm-shrinkwrap.json') ||
changedFiles.includes('package-lock.json') ||
changedFiles.includes('package.json') ||
changedFiles.includes(join('.github', 'workflows', 'main.yml'))
) {
Expand Down
4 changes: 2 additions & 2 deletions tools/tests/affected-files.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ test.only('should get all files marked as affected when the package.json is touc
t.deepEqual(affectedFiles, mockedTestFiles)
})

test.serial('should get all files marked as affected when the npm-shrinkwrap.json is touched', async (t) => {
test.serial('should get all files marked as affected when the package-lock.json is touched', async (t) => {
const consoleStub = t.context.sandbox.stub(console, 'log').callsFake(() => {})
const { affectedFiles, mockedTestFiles } = await getAffectedFilesFromMock(['npm-shrinkwrap.json'])
const { affectedFiles, mockedTestFiles } = await getAffectedFilesFromMock(['package-lock.json'])

t.truthy(consoleStub.firstCall.calledWith('All files are affected based on the changeset'))
t.deepEqual(affectedFiles, mockedTestFiles)
Expand Down
2 changes: 1 addition & 1 deletion tools/tests/utils/file-systems.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { join } from 'path'

const baseFiles = {
'npm-shrinkwrap.json': '',
'package-lock.json': '',
'README.md': '',
}

Expand Down

0 comments on commit e22c931

Please sign in to comment.