-
Notifications
You must be signed in to change notification settings - Fork 0
143 lines (138 loc) · 4.01 KB
/
ci.yml
File metadata and controls
143 lines (138 loc) · 4.01 KB
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
name: ci
on: push
jobs:
test-frontend:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
working-directory: frontend/eop_online
steps:
- name: "Checkout"
uses: actions/checkout@v2
- name: "Setup Node"
uses: actions/setup-node@v1
with:
node-version: "12"
- name: "Install dependencies"
run: "npm install"
- name: "Run frontend tests"
run: "npm run test"
- name: "Linter"
run: "npm run lint"
- name: "Check formatting"
run: "npm run formatter-check"
test-frontend-e2e:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
working-directory: frontend/eop_online
steps:
- name: "Checkout"
uses: actions/checkout@v2
- name: "Setup Node"
uses: actions/setup-node@v1
with:
node-version: "12"
- name: "Install dependencies"
run: "npm install"
- name: "Run frontend E2E tests"
run: "npm run test-e2e-with-server"
- name: "Upload E2E screenshots"
if: ${{ success() || failure() }}
uses: actions/upload-artifact@v2
with:
name: "e2e_screenshots"
path: "frontend/eop_online/e2e/screenshots"
retention-days: 7
build-frontend:
runs-on: ubuntu-latest
needs: ["test-frontend", "test-frontend-e2e"]
defaults:
run:
shell: bash
working-directory: frontend/eop_online
steps:
- name: "Checkout"
uses: actions/checkout@v2
- name: "Setup Node"
uses: actions/setup-node@v1
with:
node-version: "12"
- name: "Install dependencies"
run: "npm install"
- name: "Build app"
run: "npm run build"
- name: "Upload frontend artifact"
uses: actions/upload-artifact@v2
with:
name: "frontend"
path: "frontend/eop_online/build/"
retention-days: 1
if-no-files-found: "error"
test-backend:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- name: "Checkout"
uses: actions/checkout@v2
- name: "Setup SBT"
uses: olafurpg/setup-scala@v10
with:
java-version: openjdk@1.11
- name: "Run backend tests"
run: "sbt test"
- name: "Check formatting"
run: "sbt scalafmtCheck"
snyk-monitor:
runs-on: ubuntu-latest
if: "startsWith(github.ref, 'refs/tags/v')"
steps:
- name: "Checkout"
uses: actions/checkout@v2
- name: "Add SBT dependency graph"
run: 'echo -e "\naddSbtPlugin(\"net.virtual-void\" % \"sbt-dependency-graph\" % \"0.10.0-RC1\")" >> ./project/plugins.sbt'
shell: "bash"
- name: "Monitor backend"
uses: snyk/actions/scala@master
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
with:
command: "monitor"
args: "--sbt-graph --file=build.sbt"
- name: "Monitor frontend"
uses: snyk/actions/node@master
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
with:
command: "monitor"
args: "--file=frontend/eop_online/package-lock.json"
build-publish-docker:
runs-on: ubuntu-latest
needs: ["build-frontend", "test-backend"]
if: "startsWith(github.ref, 'refs/tags/v')"
steps:
- name: "Checkout"
uses: actions/checkout@v2
- name: "Download frontend artifact"
uses: actions/download-artifact@v2
with:
name: "frontend"
path: "frontend/eop_online/build/"
- name: "List frontend"
run: "ls -l frontend/eop_online/build/"
shell: "bash"
- name: "Login to Docker Hub"
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: "Setup SBT"
uses: olafurpg/setup-scala@v10
with:
java-version: openjdk@1.11
- name: "Build and publish docker"
run: "sbt docker:publish"