-
Notifications
You must be signed in to change notification settings - Fork 3
84 lines (70 loc) · 2.25 KB
/
tests.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: 'Tests'
on:
workflow_dispatch:
push:
schedule:
- cron: "0 0 * * 0"
permissions:
actions: none
checks: none
contents: read
deployments: none
issues: none
packages: none
pull-requests: none
repository-projects: none
security-events: none
statuses: none
# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
cancel-in-progress: true
jobs:
test:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 20.10.x
cache: npm
- name: Install
run: npm ci
- name: Clasp Project
run: echo "$CLASP_PROJECT" > ./.clasp.json
env:
CLASP_PROJECT: ${{ secrets.CLASP_PROJECT }}
- name: Creds
run: echo "$CLASP_CREDENTIALS" > ~/.clasprc.json
env:
CLASP_CREDENTIALS: ${{ secrets.CLASP_CREDENTIALS }}
- name: Creds (local)
run: echo "$CLASP_CREDENTIALS_LOCAL" > .clasprc.json
env:
CLASP_CREDENTIALS_LOCAL: ${{ secrets.CLASP_CREDENTIALS_LOCAL }}
- name: Check clasp login status
run: npm run clasp -- login --status
- name: Update secrets if changed by clasp
run: npm run update-secrets-in-ci
env:
REPO_TOKEN: ${{ secrets.REPO_TOKEN }}
CLASP_CREDENTIALS: ${{ secrets.CLASP_CREDENTIALS }}
CLASP_CREDENTIALS_LOCAL: ${{ secrets.CLASP_CREDENTIALS_LOCAL }}
- name: Prepare
run: |
mkdir -p ./tests/utilities/mwp-localtunnel-client
curl "https://gist.githubusercontent.com/$MWP_LOCALTUNNEL_CLIENT_URL_PATH" > ./tests/utilities/mwp-localtunnel-client/index.js
env:
MWP_LOCALTUNNEL_CLIENT_URL_PATH: ${{ secrets.MWP_LOCALTUNNEL_CLIENT_URL_PATH }}
- name: Test
run: npm test
env:
USE_LOCALTUNNEL: ${{ secrets.USE_LOCALTUNNEL }}
- name: Archive test artifacts (actual)
uses: actions/upload-artifact@v3
if: always()
with:
name: test-output-actual
path: tests/appscript/actual