-
Notifications
You must be signed in to change notification settings - Fork 4
179 lines (153 loc) · 4.87 KB
/
tests.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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
name: Run tests with workflow_call
on:
workflow_call:
inputs:
fluence-env:
description: "Fluence enviroment to run tests agains"
type: string
default: "local"
nox-image:
description: "nox image tag"
type: string
default: "fluencelabs/nox:unstable"
fcli-version:
description: "@fluencelabs/cli version"
type: string
default: "main"
if-no-artifacts-found:
description: "What to do when no artifacts found in setup-* actions"
type: string
default: "error"
cargo-dependencies:
description: "Cargo dependencies map"
type: string
ref:
description: "git ref to checkout to"
type: string
default: "main"
env:
CI: true
FORCE_COLOR: true
NOX_IMAGE: "${{ inputs.nox-image }}"
FLUENCE_ENV: "${{ inputs.fluence-env }}"
jobs:
aqua:
name: "Run aqua tests"
runs-on: builder
timeout-minutes: 60
permissions:
contents: read
id-token: write
steps:
- name: Import secrets
uses: hashicorp/[email protected]
with:
url: https://vault.fluence.dev
path: jwt/github
role: ci
method: jwt
jwtGithubAudience: "https://github.com/fluencelabs"
jwtTtl: 300
secrets: |
kv/docker-registry/basicauth/ci username | DOCKER_USERNAME ;
kv/docker-registry/basicauth/ci password | DOCKER_PASSWORD ;
kv/npm-registry/basicauth/ci token | NODE_AUTH_TOKEN;
- name: Checkout registry
uses: actions/checkout@v4
with:
repository: fluencelabs/registry
ref: ${{ inputs.ref }}
- name: Setup node with self-hosted registry
uses: actions/setup-node@v3
with:
node-version: "18"
registry-url: "https://npm.fluence.dev"
cache: "npm"
cache-dependency-path: "**/package-lock.json"
- name: Run npm install in aqua
run: npm install
working-directory: aqua
- name: Run npm install in aqua-tests
run: npm install
working-directory: aqua-tests
- name: Setup fcli
uses: fluencelabs/setup-fluence@v1
with:
artifact: fcli
version: ${{ inputs.fcli-version }}
if-no-artifact-found: ${{ inputs.if-no-artifacts-found }}
- name: Setup Rust toolchain
uses: dsherret/rust-toolchain-file@v1
- name: Setup marine
uses: fluencelabs/setup-marine@v1
with:
artifact-name: marine
- name: Set dependencies
if: inputs.cargo-dependencies != ''
uses: fluencelabs/github-actions/cargo-set-dependency@main
with:
dependencies: ${{ inputs.cargo-dependencies }}
path: service/
- name: Build service
env:
FLUENCE_USER_DIR: "${{ github.workspace }}/tmp/.fluence"
run: ./build.sh
working-directory: service
- name: Build distro
env:
FLUENCE_USER_DIR: "${{ github.workspace }}/tmp/.fluence"
run: ./build.sh
- name: Login to DockerHub
uses: docker/login-action@v3
with:
registry: docker.fluence.dev
username: ${{ env.DOCKER_USERNAME }}
password: ${{ env.DOCKER_PASSWORD }}
- name: Pull nox image
run: docker pull $NOX_IMAGE
- name: Run nox network
uses: isbang/[email protected]
with:
compose-file: ".github/e2e/docker-compose.yml"
down-flags: "--volumes"
- name: Setup python
uses: actions/setup-python@v4
with:
python-version: "3.9"
cache: "pip"
cache-dependency-path: aqua-tests/requirements.txt
- name: Install python requirements
run: pip install -r requirements.txt
working-directory: aqua-tests
- name: Install fcli dependencies
env:
FLUENCE_USER_DIR: "${{ github.workspace }}/tmp/.fluence"
run: fluence dep i --no-input
working-directory: aqua-tests
- name: Print fcli version
run: pytest -s test_fluence_cli_version.py
working-directory: aqua-tests
- name: Run aqua tests
env:
FLUENCE_USER_DIR: "${{ github.workspace }}/tmp/.fluence"
NPM_CONFIG_REGISTRY: "https://npm.fluence.dev"
run: pytest test_aqua.py
working-directory: aqua-tests
- name: Print versions to check summary
if: always()
working-directory: aqua-tests
run: |
cat <<SNAPSHOT >> $GITHUB_STEP_SUMMARY
## Used versions
\`\`\`
$(fluence dep v)
\`\`\`
SNAPSHOT
- name: Dump container logs
if: always()
uses: jwalton/gh-docker-logs@v2
- name: Cleanup
if: always()
run: |
rm -rf tmp ~/.fluence
sudo rm -rf registry