-
Notifications
You must be signed in to change notification settings - Fork 51
63 lines (52 loc) · 1.71 KB
/
unit.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: 'Unit'
on:
push:
branches:
- 'main'
- 'release/**/*'
pull_request:
branches:
- 'main'
- 'release/**/*'
workflow_dispatch:
concurrency:
group: '${{ github.workflow }}-${{ github.head_ref || github.ref }}'
cancel-in-progress: true
jobs:
unit:
runs-on: '${{ matrix.os }}'
permissions:
contents: 'read'
id-token: 'write'
strategy:
fail-fast: false
matrix:
os:
- 'ubuntu-latest'
- 'windows-latest'
- 'macos-latest'
steps:
- uses: 'actions/checkout@v4'
- uses: 'actions/setup-node@v4'
with:
node-version: '20.12.x' # https://github.com/nodejs/node/issues/53033
- name: 'npm build'
run: 'npm ci && npm run build'
- name: 'npm lint'
# There's no need to run the linter for each operating system, since it
# will find the same thing 3x and clog up the PR review.
if: ${{ matrix.os == 'ubuntu-latest' }}
run: 'npm run lint'
# Only authenticate if this is a full CI run.
- if: ${{ github.event_name == 'push' || github.repository == github.event.pull_request.head.repo.full_name }}
uses: 'google-github-actions/auth@v2'
with:
workload_identity_provider: '${{ vars.WIF_PROVIDER_NAME }}'
service_account: '${{ vars.SERVICE_ACCOUNT_EMAIL }}'
# The secrets will only be injected in pushes to main or from maintainers.
# If they aren't present, the associated steps are skipped.
- name: 'npm test'
run: 'npm run test'
env:
UPLOAD_CLOUD_STORAGE_TEST_BUCKET: '${{ vars.BUCKET_NAME }}'
UPLOAD_CLOUD_STORAGE_TEST_PROJECT: '${{ vars.PROJECT_ID }}'