-
Notifications
You must be signed in to change notification settings - Fork 4
78 lines (68 loc) · 2.2 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
75
76
77
78
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@a12a3943b4bdde767164f792f33f40b04645d846 # tag=v3.0.0
with:
ref: ${{ inputs.sha }}
- name: Build test image
uses: guidojw/actions/build-docker-image@2b1dea8cbd9e44491c269e771b75636026caf8ca # tag=v1.1.0
with:
file: Dockerfile
target: base
name: app
lint:
name: Lint
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout code
uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846 # tag=v3.0.0
with:
ref: ${{ inputs.sha }}
- name: Add problem matchers
run: |
echo '::add-matcher::.github/problem-matchers/ember-template-lint.json'
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@9ced9a43a244f3ac94f13bfd896db8c8f30da67a # tag=v3.0.0
with:
node-version-file: .nvmrc
- name: Load test image
uses: guidojw/actions/load-docker-image@2b1dea8cbd9e44491c269e771b75636026caf8ca # 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 lint:hbs || EXIT_STATUS=$?
docker run app yarn lint:js || EXIT_STATUS=$?
STYLELINT_OUTPUT="$(docker run app yarn lint:scss)" || EXIT_STATUS=$?
node bin/convert-stylelint-output.js "$STYLELINT_OUTPUT"
exit $EXIT_STATUS
test:
name: Test
runs-on: ubuntu-latest
needs: build
steps:
- name: Load test image
uses: guidojw/actions/load-docker-image@2b1dea8cbd9e44491c269e771b75636026caf8ca # tag=v1.1.0
with:
name: app
- name: Test
run: |
docker run -e CI=true -t app yarn test:ember