Skip to content

Commit

Permalink
Consistency pass on .github/workflows
Browse files Browse the repository at this point in the history
- Use setup-node with .nvmrc in all workflows
- Prefer to use checkout with an explicit ref in all workflows
- Minor legibility pass on step names/spacing
  • Loading branch information
Barry Gordon committed Feb 10, 2022
1 parent 8da49e9 commit de2b791
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 13 deletions.
17 changes: 12 additions & 5 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,24 @@ jobs:
language: [ 'javascript' ]

steps:
- name: Checkout repository
uses: actions/checkout@v2
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Read .nvmrc
id: nvm
run: echo ::set-output name=NVMRC::$(cat .nvmrc)

- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: ${{ steps.nvm.outputs.NVMRC }}

- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}

- name: Install dependencies
run: npm ci

- name: Build executable
run: npm run package

Expand Down
26 changes: 20 additions & 6 deletions .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,30 @@ jobs:
integration:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: GPR login
run: docker login docker.pkg.github.com -u x -p ${{ secrets.GITHUB_TOKEN }}

- name: GRP pull dependabot/dependabot-updater
run: docker pull docker.pkg.github.com/dependabot/dependabot-updater:v1

- name: GRP pull github/dependabot-update-job-proxy
run: docker pull docker.pkg.github.com/github/dependabot-update-job-proxy:v1
- run: npm ci
- name: Run integration test files

- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Read .nvmrc
id: nvm
run: echo ::set-output name=NVMRC::$(cat .nvmrc)

- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: ${{ steps.nvm.outputs.NVMRC }}

- name: Install NPM dependencies
run: npm ci

- name: Run integration tests
run: npm run test-integration
16 changes: 14 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,32 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Read .nvmrc
id: nvm
run: echo ::set-output name=NVMRC::$(cat .nvmrc)

- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: ${{ steps.nvm.outputs.NVMRC }}
- run: npm ci
- run: npm run all

- name: Install NPM dependencies
run: npm ci

- name: Run tests
run: npm run all

- run: git diff --quiet dist/
test: # make sure the action works on a clean machine without building
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}

- uses: ./
with:
milliseconds: 1000

0 comments on commit de2b791

Please sign in to comment.