-
Notifications
You must be signed in to change notification settings - Fork 24
91 lines (73 loc) · 2.52 KB
/
build.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
name: Build
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
unit-tests:
runs-on: ubuntu-latest
timeout-minutes: 15
if: ${{!contains(github.event.pull_request.labels.*.name, 'Skip unit tests')}}
steps:
- uses: actions/checkout@v4
with:
ref: ${{github.head_ref}}
repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }}
- name: Build unit test
run: |
docker build -t jasminegraph .
docker build -f ./tests/unit/Dockerfile -t jasminegraph:unit .
- uses: jupyterhub/action-k3s-helm@v4
with:
docker-enabled: true
- name: Grant permissions for default user
run: kubectl apply -f ./k8s/rbac.yaml
- name: Run unit test
run: |
mkdir /var/tmp/worker0 /var/tmp/worker1 /var/tmp/worker2 /var/tmp/worker3
chmod +x ./.github/workflows/resources/unit-test.sh
./.github/workflows/resources/unit-test.sh
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
files: ./coverage/coverage.xml
fail_ci_if_error: true
docker-integration-tests:
runs-on: ubuntu-latest
timeout-minutes: 10
if: ${{!contains(github.event.pull_request.labels.*.name, 'Skip docker integration')}}
steps:
- uses: actions/checkout@v4
with:
ref: ${{github.head_ref}}
repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }}
- name: Docker Build
run: docker build -t jasminegraph .
- name: Run Integration Tests
run: |
chmod +x test-docker.sh
./test-docker.sh
k8s-integration-tests:
runs-on: ubuntu-latest
timeout-minutes: 15
if: ${{!contains(github.event.pull_request.labels.*.name, 'Skip k8s integration')}}
steps:
- uses: actions/checkout@v4
with:
ref: ${{github.head_ref}}
repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }}
- uses: jupyterhub/action-k3s-helm@v4
with:
docker-enabled: true
- name: Grant permissions for default user
run: kubectl apply -f ./k8s/rbac.yaml
- name: Docker Build
run: docker build -t jasminegraph .
- name: K8S integration tests
run: |
mkdir /var/tmp/worker0 /var/tmp/worker1
chmod +x test-k8s.sh
./test-k8s.sh