-
Notifications
You must be signed in to change notification settings - Fork 2
136 lines (136 loc) · 4.47 KB
/
test-and-deploy.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
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
name: Test & deploy to renku-kg-dev
on:
push:
branches:
- development
- release
- "hotfix-[0-9]+.[0-9]+**"
pull_request:
types:
- opened
- synchronize
- reopened
env:
SBT_OPTS: "-Xmx3G -XX:+UseG1GC"
jobs:
cleanup-previous-runs:
name: Cleanup previous runs
runs-on: ubuntu-latest
if: github.event.action != 'closed'
steps:
- uses: rokroskar/workflow-run-cleanup-action@v0.3.0
env:
GITHUB_TOKEN: "${{ secrets.RENKUBOT_GITHUB_TOKEN }}"
conventional-commits:
name: Commit message check
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- uses: amannn/action-semantic-pull-request@v1.1.1
env:
GITHUB_TOKEN: ${{ secrets.RENKUBOT_GITHUB_TOKEN }}
unit-tests:
name: Unit tests
runs-on: ubuntu-latest
needs: cleanup-previous-runs
steps:
- uses: actions/checkout@v3
- name: JDK set-up
uses: actions/setup-java@v3
with:
distribution: "temurin"
java-version: "21"
- name: Setup cache
uses: actions/cache@v2
with:
path: |
~/.ivy2
~/.cache/coursier
~/.sbt
key: ${{ runner.os }}-sbt-${{ hashFiles('**/build.sbt') }}
- name: Unit test
run: sbt -Dsbt.color=always -Dsbt.supershell=false clean test
acceptance-tests:
name: Graph acceptance tests
runs-on: ubuntu-latest
needs: cleanup-previous-runs
steps:
- uses: actions/checkout@v3
- name: JDK set-up
uses: actions/setup-java@v3
with:
distribution: "temurin"
java-version: "21"
- name: Setup cache
uses: actions/cache@v2
with:
path: |
~/.ivy2
~/.cache/coursier
~/.sbt
key: ${{ runner.os }}-sbt-${{ hashFiles('**/build.sbt') }}
- name: Acceptance tests
run: sbt -Dsbt.color=always -Dsbt.supershell=false "project acceptance-tests" clean test
formatter:
name: Formatting check
runs-on: ubuntu-latest
needs: cleanup-previous-runs
steps:
- uses: actions/checkout@v3
- name: JDK set-up
uses: actions/setup-java@v3
with:
distribution: "temurin"
java-version: "21"
- name: Setup cache
uses: actions/cache@v2
with:
path: |
~/.ivy2
~/.cache/coursier
~/.sbt
key: ${{ runner.os }}-sbt-${{ hashFiles('**/build.sbt') }}
- name: Formatter
run: sbt scalafmtCheck
deploy-to-graph:
name: Deploy to renku-kg-dev
runs-on: ubuntu-20.04
needs: [unit-tests, acceptance-tests, formatter]
if: "github.ref == 'refs/heads/development'"
environment:
name: renku-kg-dev
steps:
- name: Deploy to renku-kg-dev
uses: SwissDataScienceCenter/renku-actions/deploy-renku@v1.13.0
env:
DOCKER_PASSWORD: ${{ secrets.RENKU_DOCKER_PASSWORD }}
DOCKER_USERNAME: ${{ secrets.RENKU_DOCKER_USERNAME }}
GITLAB_TOKEN: ${{ secrets.DEV_GITLAB_TOKEN }}
KUBECONFIG: "${{ github.workspace }}/renkubot-kube.config"
RANCHER_PROJECT_ID: ${{ secrets.CI_RANCHER_PROJECT }}
RENKU_RELEASE: renku-kg-dev
RENKU_VALUES_FILE: "${{ github.workspace }}/values.yaml"
RENKU_VALUES: ${{ secrets.CI_RENKU_KG_VALUES_COMBINED }}
RENKUBOT_KUBECONFIG: ${{ secrets.RENKUBOT_DEV_KUBECONFIG }}
RENKUBOT_RANCHER_BEARER_TOKEN: ${{ secrets.RENKUBOT_RANCHER_BEARER_TOKEN }}
RANCHER_DEV_API_ENDPOINT: ${{ secrets.RANCHER_DEV_API_ENDPOINT }}
RENKU_BOT_DEV_PASSWORD: ${{ secrets.RENKU_BOT_DEV_PASSWORD }}
RENKU_ANONYMOUS_SESSIONS: true
RENKU_TESTS_ENABLED: true
TEST_ARTIFACTS_PATH: "tests-artifacts-${{ github.sha }}"
renku_graph: "@development"
renku: "@master"
renku-acceptance-tests:
name: Renku acceptance tests against renku-kg-dev
runs-on: ubuntu-20.04
needs: deploy-to-graph
steps:
- uses: SwissDataScienceCenter/renku-actions/test-renku@v1.13.0
with:
kubeconfig: ${{ secrets.RENKUBOT_DEV_KUBECONFIG }}
renku-release: renku-kg-dev
gitlab-token: ${{ secrets.DEV_GITLAB_TOKEN }}
persist: true
s3-results-access-key: ${{ secrets.ACCEPTANCE_TESTS_BUCKET_ACCESS_KEY }}
s3-results-secret-key: ${{ secrets.ACCEPTANCE_TESTS_BUCKET_SECRET_KEY }}
test-timeout-mins: "140"