-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (42 loc) · 1.44 KB
/
check.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
name: "Checking app: testing and linting"
on:
pull_request:
branches:
- main
jobs:
check:
runs-on: ubuntu-20.04
name: "Checking app: testing and linting"
container:
image: cypress/browsers:node14.17.0-chrome88-ff89
steps:
- uses: actions/checkout@v3
- 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 dependencies
run: npm install
- name: Add env values
run: |
echo 'CONTACT_FORM_URL="${{ secrets.CONTACT_FORM_URL }}"' > .env
echo 'CONTACT_FORM_EMAIL_NAME="${{ secrets.CONTACT_FORM_EMAIL_NAME }}"' >> .env
echo 'CONTACT_FORM_QUESTION_NAME="${{ secrets.CONTACT_FORM_QUESTION_NAME }}"' >> .env
echo 'MAPBOX_STYLE="${{ secrets.MAPBOX_STYLE }}"' >> .env
echo 'MAPBOX_TOKEN="${{ secrets.MAPBOX_TOKEN }}"' >> .env
- name: Test application
run: npm run test
- name: Lint codebase
run: npm run lint
- name: Cypress run
uses: cypress-io/github-action@v4
with:
start: npm run dev:cypress
wait-on: http://localhost:5173