-
Notifications
You must be signed in to change notification settings - Fork 4
68 lines (65 loc) · 2.08 KB
/
spa-server-ci.yml
File metadata and controls
68 lines (65 loc) · 2.08 KB
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
name: CI
on:
push:
branches:
- 'master'
- 'develop_*'
workflow_dispatch:
jobs:
changes:
runs-on: ubuntu-latest
# Required permissions
permissions:
pull-requests: read
# Set job outputs to values from filter step
outputs:
check_server: ${{ steps.filter.outputs.check_server }}
check_js_client: ${{ steps.filter.outputs.check_js_client }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
check_server:
- 'client/**'
- 'server/**'
- 'Cargo.lock'
check_js_client:
- 'jsclient/**'
check_server:
needs: changes
if: ${{ needs.changes.outputs.check_server == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: Swatinem/rust-cache@v2
- name: run integration test 1
run: cargo test -p tests --test http_test -j 1 -- --test-threads 1
- name: run integration test 2
run: cargo test -p tests --test admin_server_test -j 1 -- --test-threads 1
- name: run spa-client test
run: cargo test -p spa-client -j 1 -- --test-threads 1
- name: run spa-server test
run: cargo test -p spa-server
check_js_client:
needs: changes
if: ${{ needs.changes.outputs.check_js_client == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run spa-server docker
run: |
docker run -d --name=test -p 9000:9000 -p 8080:8080 -v ${{ github.workspace }}/jsclient/test/config.toml:/config/config.toml ghcr.io/fornetcode/spa-server:v3.0.0
docker ps
docker logs --tail 50 test
- uses: actions/setup-node@v4
with:
node-version: '20.x'
cache: 'npm'
cache-dependency-path: './jsclient/package-lock.json'
- run: |
cd ./example/js-app-example && npm ci && npm run build && \
cd ../../jsclient && npm ci && npm test && npm run build