1+ name : CI
2+
3+ on :
4+ push :
5+ pull_request :
6+ workflow_dispatch :
7+
8+ # Permissions needed to push to gh-pages
9+ permissions :
10+ contents : write
11+ pages : write
12+
13+ jobs :
14+ openapi-client-generation :
15+ runs-on : ubuntu-latest
16+ steps :
17+ - uses : actions/checkout@v4
18+
19+ - name : Set up Node.js
20+ uses : actions/setup-node@v4
21+ with :
22+ node-version : ' 20.x'
23+ cache : ' npm'
24+
25+ - name : Install dependencies
26+ run : npm ci
27+
28+ - name : Verify OpenAPI client generation
29+ run : |
30+ # Store hash of essential generated files
31+ find src -type f \( -name "*.ts" -o -name "*.json" \) -not -path "*/\.*" -exec sha256sum {} \; | sort > generated_files.hash
32+ # Generate again
33+ npm run generate
34+ # Compare hashes of essential files
35+ find src -type f \( -name "*.ts" -o -name "*.json" \) -not -path "*/\.*" -exec sha256sum {} \; | sort > new_generated_files.hash
36+ if ! diff generated_files.hash new_generated_files.hash; then
37+ echo "ERROR: Generated files differ from committed files."
38+ echo "This usually means that the OpenAPI client code needs to be regenerated."
39+ echo "Please run 'npm run generate' locally and commit the changes."
40+ echo ""
41+ echo "Differences found in the following files:"
42+ diff generated_files.hash new_generated_files.hash || true
43+ exit 1
44+ fi
45+
46+ test :
47+ runs-on : ubuntu-latest
48+ steps :
49+ - uses : actions/checkout@v4
50+
51+ - name : Set up Node.js
52+ uses : actions/setup-node@v4
53+ with :
54+ node-version : ' 20.x'
55+ cache : ' npm'
56+
57+ - name : Install dependencies
58+ run : npm ci
59+
60+ - name : Set up Julia
61+ uses : julia-actions/setup-julia@v2
62+
63+ - name : Cache Julia packages
64+ uses : julia-actions/cache@v2
65+
66+ - name : Clone RxInferServer
67+ run : |
68+ git clone https://github.com/lazydynamics/RxInferServer.git
69+ cd RxInferServer
70+
71+ - name : Build RxInferServer
72+ uses : julia-actions/julia-buildpkg@v1
73+
74+ - name : Start RxInferServer in background and execute tests
75+ run : |
76+ cd RxInferServer
77+ make docker
78+ make dev &
79+ cd ..
80+ npm test
81+
82+ docs :
83+ runs-on : ubuntu-latest
84+ permissions :
85+ contents : write
86+ steps :
87+ - uses : actions/checkout@v4
88+
89+ - name : Set up Node.js
90+ uses : actions/setup-node@v4
91+ with :
92+ node-version : ' 20.x'
93+ cache : ' npm'
94+
95+ - name : Install dependencies
96+ run : npm ci
97+
98+ - name : Set up Julia
99+ uses : julia-actions/setup-julia@v2
100+
101+ - name : Cache Julia packages
102+ uses : julia-actions/cache@v2
103+
104+ - name : Clone RxInferServer
105+ run : |
106+ git clone https://github.com/lazydynamics/RxInferServer.git
107+ cd RxInferServer
108+
109+ - name : Build RxInferServer
110+ uses : julia-actions/julia-buildpkg@v1
111+
112+ - name : Start RxInferServer in background and build docs
113+ run : |
114+ cd RxInferServer
115+ make docker
116+ make dev &
117+ cd ..
118+ npm run docs
119+
120+ - name : Deploy documentation
121+ if : github.ref == 'refs/heads/main'
122+ uses : peaceiris/actions-gh-pages@v3
123+ with :
124+ github_token : ${{ secrets.GITHUB_TOKEN }}
125+ publish_dir : ./docs/build
126+ publish_branch : gh-pages
0 commit comments