Repository navigation
56 lines (45 loc) · 1.43 KB
/
Copy pathtest.yml
File metadata and controls
56 lines (45 loc) · 1.43 KB
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
name: Test workflow
env:
FIREBASE_SERVICE_ACCOUNT: ${{ secrets.FIREBASE_SERVICE_ACCOUNT }}
STRIPE_SECRET: ${{ secrets.STRIPE_SECRET }}
STORAGE_BUCKET: machii-dev.appspot.com
on:
pull_request:
branches: [ master, develop ]
jobs:
lint-and-test:
name: Lint code base and run tests
runs-on: ubuntu-latest
steps:
- name: Install stripe-cli
run: |
curl https://packages.stripe.dev/api/security/keypair/stripe-cli-gpg/public | sudo apt-key add -
echo "deb https://packages.stripe.dev/stripe-cli-debian-local stable main" | sudo tee -a /etc/apt/sources.list
sudo apt update
sudo apt install stripe
- name: Checkout code
uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: '14.x'
- name: Cache node modules
uses: actions/cache@v2
with:
path: ~/.npm
key: v1-npm-deps-${{ hashFiles('**/package-lock.json') }}
restore-keys: v1-npm-deps-
- name: Install dependencies
run: npm ci
- name: Lint
run: npm run lint
- name: Run Jest Tests
run: npm test
- name: Format
run: npm run format
- name: Commit changes
uses: EndBug/add-and-commit@v7
with:
author_name: Hoang Nguyen
author_email: minh.hoang1297@gmail.com
message: 'Lint and reformat'