Skip to content

Commit

Permalink
Merge pull request #135 from github/update-workflows
Browse files Browse the repository at this point in the history
Update all Actions Workflows
  • Loading branch information
GrantBirki authored Mar 20, 2023
2 parents 75ca0be + 2088fb2 commit 22e46e3
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 21 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "CodeQL"
name: CodeQL

on:
push:
Expand All @@ -25,8 +25,8 @@ jobs:
language: [ 'javascript' ]

steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: checkout
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # pin@v3.3.0

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Expand Down
18 changes: 12 additions & 6 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,20 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # pin@v3.0.2
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # pin@v3.3.0

- uses: actions/cache@48af2dc4a9e8278b89d7fa154b955c30c6aaab09 # pin@v3
# check the node version from the .node-version file
- name: fetch node version
id: node-version
run: |
version=$(cat .node-version)
echo "version=${version}" >> $GITHUB_OUTPUT
- name: setup node
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # pin@v3.6.0
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
node-version: ${{ steps.node-version.outputs.version }}
cache: 'npm'

- name: install dependencies
run: npm ci
Expand Down
19 changes: 13 additions & 6 deletions .github/workflows/package-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,22 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@7884fcad6b5d53d10323aee724dc68d8b9096a2e # pin@v2
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # pin@v3.3.0

- name: Setup Node.js 18.x
uses: actions/setup-node@2fddd8803e2f5c9604345a0b591c3020ee971a93 # pin@v3.4.1
# check the node version from the .node-version file
- name: fetch node version
id: node-version
run: |
version=$(cat .node-version)
echo "version=${version}" >> $GITHUB_OUTPUT
- name: setup node
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # pin@v3.6.0
with:
node-version: 18.x
node-version: ${{ steps.node-version.outputs.version }}
cache: 'npm'

- name: Install dependencies
- name: install dependencies
run: npm ci

- name: Rebuild the dist/ directory
Expand All @@ -36,7 +43,7 @@ jobs:
id: diff

# If index.js was different than expected, upload the expected version as an artifact
- uses: actions/upload-artifact@82c141cc518b40d92cc801eee768e7aafc9c2fa2 # pin@v2
- uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # pin@v3.1.2
if: ${{ failure() && steps.diff.conclusion == 'failure' }}
with:
name: dist
Expand Down
18 changes: 12 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,20 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # pin@v3.0.2
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # pin@v3.3.0

- uses: actions/cache@48af2dc4a9e8278b89d7fa154b955c30c6aaab09 # pin@v3
# check the node version from the .node-version file
- name: fetch node version
id: node-version
run: |
version=$(cat .node-version)
echo "version=${version}" >> $GITHUB_OUTPUT
- name: setup node
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # pin@v3.6.0
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
node-version: ${{ steps.node-version.outputs.version }}
cache: 'npm'

- name: install dependencies
run: npm ci
Expand Down

0 comments on commit 22e46e3

Please sign in to comment.