Skip to content

Commit 5a36c06

Browse files
XhmikosRJustinBeckwith
andauthoredOct 5, 2021
build: update CI config (#338)
* make use of `actions/setup-node@v2` `cache` option * update CodeQL workflow to the latest recommended one Co-authored-by: Justin Beckwith <beckwith@google.com>
1 parent ea23759 commit 5a36c06

File tree

2 files changed

+10
-43
lines changed

2 files changed

+10
-43
lines changed
 

‎.github/workflows/ci.yaml

+5-39
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,7 @@ jobs:
1919
- uses: actions/setup-node@v2
2020
with:
2121
node-version: ${{ matrix.node }}
22-
- name: Set up npm cache
23-
uses: actions/cache@v2
24-
with:
25-
path: ~/.npm
26-
key: ${{ runner.os }}-node-v${{ matrix.node }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }}
27-
restore-keys: |
28-
${{ runner.os }}-node-v${{ matrix.node }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }}
22+
cache: npm
2923
- run: npm ci
3024
- run: npm test
3125
- run: npm run codecov
@@ -37,17 +31,7 @@ jobs:
3731
- uses: actions/setup-node@v2
3832
with:
3933
node-version: ${{ env.NODE }}
40-
- name: Get npm cache directory
41-
id: npm-cache
42-
run: |
43-
echo "::set-output name=dir::$(npm config get cache)"
44-
- name: Set up npm cache
45-
uses: actions/cache@v2
46-
with:
47-
path: ${{ steps.npm-cache.outputs.dir }}
48-
key: ${{ runner.os }}-node-v${{ env.NODE }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }}
49-
restore-keys: |
50-
${{ runner.os }}-node-v${{ env.NODE }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }}
34+
cache: npm
5135
- run: npm ci
5236
- run: npm test
5337
lint:
@@ -57,13 +41,7 @@ jobs:
5741
- uses: actions/setup-node@v2
5842
with:
5943
node-version: ${{ env.NODE }}
60-
- name: Set up npm cache
61-
uses: actions/cache@v2
62-
with:
63-
path: ~/.npm
64-
key: ${{ runner.os }}-node-v${{ env.NODE }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }}
65-
restore-keys: |
66-
${{ runner.os }}-node-v${{ env.NODE }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }}
44+
cache: npm
6745
- run: npm ci
6846
- run: npm run lint
6947
docs:
@@ -73,13 +51,7 @@ jobs:
7351
- uses: actions/setup-node@v2
7452
with:
7553
node-version: ${{ env.NODE }}
76-
- name: Set up npm cache
77-
uses: actions/cache@v2
78-
with:
79-
path: ~/.npm
80-
key: ${{ runner.os }}-node-v${{ env.NODE }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }}
81-
restore-keys: |
82-
${{ runner.os }}-node-v${{ env.NODE }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }}
54+
cache: npm
8355
- run: npm ci
8456
- run: npm run docs-test
8557
release:
@@ -91,13 +63,7 @@ jobs:
9163
- uses: actions/setup-node@v2
9264
with:
9365
node-version: ${{ env.NODE }}
94-
- name: Set up npm cache
95-
uses: actions/cache@v2
96-
with:
97-
path: ~/.npm
98-
key: ${{ runner.os }}-node-v${{ env.NODE }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }}
99-
restore-keys: |
100-
${{ runner.os }}-node-v${{ env.NODE }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }}
66+
cache: npm
10167
- run: npm ci
10268
- run: npm run compile
10369
- run: npm run build-binaries

‎.github/workflows/codeql.yml

+5-4
Original file line numberDiff line numberDiff line change
@@ -9,26 +9,27 @@ on:
99
# The branches below must be a subset of the branches above
1010
branches:
1111
- main
12+
- "!renovate/**"
1213
schedule:
1314
- cron: "0 0 * * 0"
1415

1516
jobs:
1617
analyze:
1718
name: Analyze
1819
runs-on: ubuntu-latest
20+
permissions:
21+
actions: read
22+
contents: read
23+
security-events: write
1924

2025
steps:
2126
- name: Checkout repository
2227
uses: actions/checkout@v2
2328

24-
# Initializes the CodeQL tools for scanning.
2529
- name: Initialize CodeQL
2630
uses: github/codeql-action/init@v1
2731
with:
2832
languages: "javascript"
2933

30-
- name: Autobuild
31-
uses: github/codeql-action/autobuild@v1
32-
3334
- name: Perform CodeQL Analysis
3435
uses: github/codeql-action/analyze@v1

0 commit comments

Comments
 (0)
Please sign in to comment.