-
Notifications
You must be signed in to change notification settings - Fork 4
86 lines (75 loc) · 2.67 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
79
80
81
82
83
84
85
86
name: Continuous Integration
on:
push:
branches: [staging, master]
pull_request:
workflow_call:
inputs:
sha:
description: The commit SHA to run the workflow on
required: false
type: string
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3.0.2
with:
ref: ${{ inputs.sha }}
- name: Build test image
uses: guidojw/actions/build-docker-image@5faa9418b42a6a77f81e11ae935287900673f98b # tag=v1.3.2
with:
file: Dockerfile
target: base
name: app
lint:
name: Lint
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout code
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3.0.2
with:
ref: ${{ inputs.sha }}
- name: Add problem matchers
run: |
echo '::add-matcher::.github/problem-matchers/actionlint.json'
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: Download actionlint
run: |
bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash) 1.6.15
- name: Set up Node.js
uses: actions/setup-node@2fddd8803e2f5c9604345a0b591c3020ee971a93 # tag=v3.4.1
with:
node-version-file: .nvmrc
- name: Load test image
uses: guidojw/actions/load-docker-image@5faa9418b42a6a77f81e11ae935287900673f98b # tag=v1.3.2
with:
name: app
- name: Lint
# Convert output of stylelint so that the problem matcher can match it correctly.
run: |
EXIT_STATUS=0
./actionlint -ignore 'property "app_private_key" is not defined' -ignore 'SC2153:' \
-ignore 'property "sha" is not defined in object type {}' || EXIT_STATUS=$?
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@5faa9418b42a6a77f81e11ae935287900673f98b # tag=v1.3.2
with:
name: app
- name: Test
run: |
docker run -e CI=true -t app yarn test:ember