This repository has been archived by the owner on Apr 27, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
98 lines (89 loc) · 2.73 KB
/
ci.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
87
88
89
90
91
92
93
94
95
96
97
98
name: CI
on:
pull_request:
types: [opened, synchronize, reopened]
push:
branches:
- master
env:
IMAGE_TAG: ${{ github.sha }}
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
with:
submodules: 'true'
- uses: actions/setup-node@v1
with:
node-version: '12.22'
- uses: actions/cache@v1
with:
path: node_modules
key: ${{ runner.os }}-yarn-client-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-client-
- name: Lint & Test
run: |
make lint
make test
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
with:
submodules: 'true'
- uses: actions/setup-node@v1
with:
node-version: '12.22'
- uses: actions/cache@v1
with:
path: node_modules
key: ${{ runner.os }}-yarn-client-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-client-
- name: Build and Package Container Images
run: |
make build_prod
make build_xpub_postgres
mkdir -p docker-image
docker save -o docker-image/reviewer-submission.tar libero/reviewer-submission:${IMAGE_TAG}
docker save -o docker-image/reviewer-xpub-postgres.tar libero/reviewer-xpub-postgres:${IMAGE_TAG}
- uses: actions/upload-artifact@v1
with:
name: docker-image
path: docker-image
integration-tests-and-push:
needs: [test, build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
with:
submodules: 'true'
- uses: actions/setup-node@v1
with:
node-version: '12.22'
- uses: actions/cache@v1
with:
path: node_modules
key: ${{ runner.os }}-yarn-client-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-client-
- uses: actions/download-artifact@v1
with:
name: docker-image
- name: Load Images, Setup Services, Run Integration Tests
run: |
docker load -i docker-image/reviewer-submission.tar
docker load -i docker-image/reviewer-xpub-postgres.tar
make setup
make start_ci
make test_integration
- name: Push Images if on master
if: github.ref == 'refs/heads/master'
run: |
.scripts/github/retag-and-push.sh reviewer-submission ${IMAGE_TAG}
.scripts/github/retag-and-push.sh reviewer-xpub-postgres ${IMAGE_TAG}
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}