-
Notifications
You must be signed in to change notification settings - Fork 22
64 lines (55 loc) · 1.65 KB
/
polly.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
name: Polly Recordings
on:
push:
branches-ignore:
- polly-recordings
- master
paths:
- '**.ts'
- '**.har'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '16'
- name: Cache node modules
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: install
run: npm ci
- name: test
run: |
export TEST_ACCESS_TOKEN=$(npm -s run dev:refresh-token -)
npm t
env:
TEST_ACCESS_TOKEN: ${{ secrets.TEST_ACCESS_TOKEN }}
TEST_CLIENT_ID: ${{ secrets.TEST_CLIENT_ID }}
TEST_CLIENT_SECRET: ${{ secrets.TEST_CLIENT_SECRET }}
TEST_REFRESH_TOKEN: ${{ secrets.TEST_REFRESH_TOKEN }}
TEST_SCOPE: ${{ secrets.TEST_SCOPE }}
POLLY_RECORD_IF_MISSING: 'true'
CI: "true"
- name: Commit files
if: ${{ always() }}
run: |
git config --local user.email "[email protected]"
git config --local user.name "Scale Bot"
git add -A test/__recordings__
git diff-index --quiet HEAD || git commit -m "test: adds Polly recordings [skip ci]"
- name: Push changes
if: ${{ always() }}
uses: ad-m/github-push-action@master
with:
branch: ${{ github.ref }}
github_token: ${{ secrets.GITHUB_TOKEN }}