-
Notifications
You must be signed in to change notification settings - Fork 4
143 lines (141 loc) · 3.97 KB
/
ci.yaml
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:
pull_request:
paths:
- deps/**
- utils/**
- client/**
- snapi-frontend/**
- snapi-truffle/**
- snapi-client/**
- python-client/**
- sql-client/**
- .github/workflows/ci.yaml
workflow_dispatch:
env:
SBT_OPTS : -Dsbt.log.noformat=true -Xss2m -Xms1g
jobs:
build:
runs-on: self-hosted
container:
image: ghcr.io/raw-labs/raw-scala-runner:21.0.0-ol9-20230919_scala2.12.18_sbt1.9.6
options: --user 1001
credentials:
username: ${{ github.actor }}
password: ${{ secrets.READ_PACKAGES }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: ./rebuild.sh
- name: upload build artifacts
uses: actions/upload-artifact@v4
with:
name: build
path: /home/sbtuser/.ivy2/local
retention-days: 1
- name: upload versions
uses: actions/upload-artifact@v4
with:
name: versions
path: ./**/version
retention-days: 1
code-checks:
needs: build
strategy:
fail-fast: false
matrix:
component:
- utils
- client
- snapi-frontend
- snapi-truffle
- snapi-client
- python-client
- sql-client
runs-on: self-hosted
container:
image: ghcr.io/raw-labs/raw-scala-runner:21.0.0-ol9-20230919_scala2.12.18_sbt1.9.6
options: --user 1001
credentials:
username: ${{ github.actor }}
password: ${{ secrets.READ_PACKAGES }}
steps:
- uses: actions/checkout@v4
- name: download build artifacts
uses: actions/download-artifact@v4
with:
name: build
path: /home/sbtuser/.ivy2/local
- name: download versions
uses: actions/download-artifact@v4
with:
name: versions
- name: headers
run: sbt headerCheckAll
working-directory: ${{ matrix.component }}
- name: scala fmt
run: sbt scalafmtCheckAll
working-directory: ${{ matrix.component }}
- name: java fmt
run: sbt javafmtCheckAll
working-directory: ${{ matrix.component }}
- name: doc
run: sbt doc
working-directory: ${{ matrix.component }}
tests:
needs: build
strategy:
fail-fast: false
matrix:
component:
- snapi-frontend
- snapi-client
- sql-client
runs-on: self-hosted
env:
SBT_FORK_OUTPUT_DIR : test-results
COURSIER_PROGRESS : false
container:
image: ghcr.io/raw-labs/raw-scala-runner:21.0.0-ol9-20230919_scala2.12.18_sbt1.9.6
options: --user 1001 --cpus 6 --memory 32g -e HOME=/home/sbtuser
credentials:
username: ${{ github.actor }}
password: ${{ secrets.READ_PACKAGES }}
steps:
- uses: actions/checkout@v4
- uses: oNaiPs/secrets-to-env-action@v1
with:
secrets: ${{ toJSON(secrets) }}
- name: download build artifacts
uses: actions/download-artifact@v4
with:
name: build
path: /home/sbtuser/.ivy2/local
- name: download versions
uses: actions/download-artifact@v4
with:
name: versions
- name: test
run: |
test_version=$(cat ./version)
echo "Testing ${{ matrix.component }} version: $test_version"
./test.sh
working-directory: ${{ matrix.component }}
- uses: mikepenz/action-junit-report@v3
if: success() || failure()
with:
report_paths: ./**/test-reports/*.xml
detailed_summary: true
- uses: actions/upload-artifact@v3
with:
name: executor-logs
path: test-results/executor-logs
retention-days: 4
if-no-files-found: ignore
- uses: actions/upload-artifact@v3
with:
name: heap-dumps
path: test-results/heap-dumps
retention-days: 4
if-no-files-found: ignore