-
Notifications
You must be signed in to change notification settings - Fork 1
93 lines (87 loc) · 2.8 KB
/
validation.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
85
86
87
88
89
90
91
92
93
# Workflow for validating pull requests
name: Validation
# Triggers the workflow on push or pull request for the main branch
on:
push:
branches: [main]
pull_request:
jobs:
# Ensure builds succeed
build:
runs-on: ubuntu-latest
steps:
- name: Checkout the repo
uses: actions/checkout@v2
- uses: actions/cache@v2
id: modules-cache
with:
path: node_modules
key: ${{ runner.os }}-modules-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
if: steps.modules-cache.outputs.cache-hit != 'true'
run: yarn install --frozen-lockfile --prefer-offline
- name: Build app
run: yarn build --frozen-lockfile
# Ensure lint checks pass
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout the repo
uses: actions/checkout@v2
- uses: actions/cache@v2
id: modules-cache
with:
path: node_modules
key: ${{ runner.os }}-modules-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
if: steps.modules-cache.outputs.cache-hit != 'true'
run: yarn install --frozen-lockfile --prefer-offline
- name: Lint
run: yarn lint
# Ensure Prettier was used
style:
runs-on: ubuntu-latest
steps:
- name: Checkout the repo
uses: actions/checkout@v2
- name: Install Prettier
run: yarn global add prettier@~2.4.0
- name: Style
run: $(yarn global bin)/prettier --check . || $(yarn global bin)/prettier --write . && git diff --exit-code
# Ensure tests pass
test:
runs-on: ubuntu-latest
steps:
- name: Checkout the repo
uses: actions/checkout@v2
- uses: actions/cache@v2
id: modules-cache
with:
path: node_modules
key: ${{ runner.os }}-modules-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
if: steps.modules-cache.outputs.cache-hit != 'true'
run: yarn install --frozen-lockfile --prefer-offline
- name: Cache firebase emulators
uses: actions/cache@v2
with:
path: ~/.cache/firebase/emulators
key: ${{ runner.os }}-firebase-emulators-${{ hashFiles('~/.cache/firebase/emulators/**') }}
continue-on-error: true
- run: yarn ci-test
# Ensure Translations are updated
translations:
runs-on: ubuntu-latest
steps:
- name: Checkout the repo
uses: actions/checkout@v2
- name: Install i18next-parser
run: yarn global add i18next-parser@~6.0.0
- name: Check translations
run: $(yarn global bin)/i18next --fail-on-warnings && git diff --exit-code