-
Notifications
You must be signed in to change notification settings - Fork 4
74 lines (64 loc) · 2.04 KB
/
continuous-integration.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
name: Continuous Integration
on:
push:
branches: [staging, master]
pull_request:
workflow_call:
inputs:
sha:
required: false
type: string
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # renovate: tag=v2.4.0
with:
ref: ${{ inputs.sha }}
- name: Build test image
uses: guidojw/actions/build-docker-image@2b1dea8cbd9e44491c269e771b75636026caf8ca # renovate: tag=v1.1.0
with:
file: Dockerfile.test
name: app
lint:
name: Lint
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout code
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # renovate: tag=v2.4.0
with:
ref: ${{ inputs.sha }}
- name: Add problem matchers
run: |
echo '::add-matcher::.github/problem-matchers/eslint-stylish.json'
echo '::add-matcher::.github/problem-matchers/stylelint.json'
- name: Set up Node.js
uses: actions/setup-node@1f8c6b94b26d0feae1e387ca63ccbdc44d27b561 # renovate: tag=v2.5.1
with:
node-version: '14'
- name: Load test image
uses: guidojw/actions/load-docker-image@2b1dea8cbd9e44491c269e771b75636026caf8ca # renovate: tag=v1.1.0
with:
name: app
- name: Lint
# Convert output of stylelint so that the problem matcher can match it correctly.
run: |
EXIT_STATUS=0
docker run app yarn ci:eslint || EXIT_STATUS=$?
node bin/convert-stylelint-output.js "$(docker run app yarn ci:stylelint)" || EXIT_STATUS=$?
exit $EXIT_STATUS
test:
name: Test
runs-on: ubuntu-latest
needs: build
steps:
- name: Load test image
uses: guidojw/actions/load-docker-image@2b1dea8cbd9e44491c269e771b75636026caf8ca # renovate: tag=v1.1.0
with:
name: app
- name: Test
run: |
docker run -t app yarn test