Skip to content

Commit ec3ebb9

Browse files
authored
Fix the Nix CI (#846)
- Update flake.nix - Fix WSS vs. HTTPS API - Fix outdate Java version - Fix C++ compiler not in path - Fix incompatible dependencies in package.json - Remove Ruby SDK from justfile
1 parent 5fbb414 commit ec3ebb9

File tree

6 files changed

+8144
-77
lines changed

6 files changed

+8144
-77
lines changed

Readme.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,13 @@ just release-rust 0.1.0
113113
As the SDKs need credentials to authenticate to the VaaS API. You need to provide them in a `.env` file. Copy your `.env` file into the root directory of the project. The C++ SDK needs special credentials, which you can provide in a `.cpp.env` file.
114114

115115
```bash
116-
# Copy the .env and .cpp.env file to all SDK folders
116+
# Copy the .env.wss and .env.https files to all SDK folders
117117
# to be able to run the integration tests
118118
just populate-env
119119

120+
# If you see any strange error, e.g. not found compiler. Try to clean the project
121+
# and populate the environment again.
122+
just clean-all
123+
just populate-env
124+
```
125+

flake.lock

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
pkgs.clippy
2424
pkgs.rustfmt
2525
] ++ lib.optional pkgs.stdenv.isDarwin [
26-
pkgs.darwin.apple_sdk.frameworks.Cocoa
2726
pkgs.libiconv
2827
pkgs.iconv
2928
];
@@ -51,7 +50,7 @@
5150
];
5251

5352
javaDeps = [
54-
pkgs.jdk22
53+
pkgs.jdk24
5554
pkgs.gradle
5655
];
5756

@@ -66,6 +65,7 @@
6665
pkgs.curl
6766
pkgs.jsoncpp
6867
pkgs.doctest
68+
pkgs.clang
6969
];
7070

7171
in
@@ -87,12 +87,16 @@
8787
++ cppDeps;
8888

8989
shellHook = ''
90-
alias c=cargo
91-
alias j=just
92-
alias lg=lazygit
93-
alias ll="ls -la"
94-
alias lll="ls -lah"
95-
'';
90+
alias c=cargo
91+
alias j=just
92+
alias lg=lazygit
93+
alias ll="ls -la"
94+
alias lll="ls -lah"
95+
96+
# Set path to C++ compiler
97+
export CC=${pkgs.clang}/bin/clang
98+
export CXX=${pkgs.clang}/bin/clang++
99+
'';
96100

97101
DOTNET_CLI_HOME = "/tmp/nix/.dotnet";
98102
GOPATH = "/tmp/nix/.go";

justfile

Lines changed: 57 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -17,46 +17,67 @@
1717

1818
version := "0.0.0"
1919

20-
# Copy a `.env` file from the root directory to all
21-
# language directories. For the C++ SDK, an `.cpp.env` is
22-
# required, as the C++ SDK needs different credentials to
23-
# be run in the statigin environment.
24-
# ATTENTION: The `.env` & `.cpp.env` has to be placed manually in the
25-
# root directory, as secrets must not be checked into
26-
# the git repository.
27-
populate-env:
28-
mkdir -p cpp/build && cp .cpp.env cpp/build/.env
29-
cp .env rust/.env
30-
cp .env typescript/.env
31-
cp .env dotnet/.env
32-
cp .env python/.env
33-
cp .env golang/vaas/.env
34-
cp .env golang/vaas/v2/.env
35-
cp .env golang/vaas/v2/examples/file-verdict-request/.env
36-
cp .env golang/vaas/v2/examples/vaasctl/.env
37-
cp .env golang/vaas/v2/pkg/vaas/.env
38-
cp .env golang/vaas/v2/pkg/authenticator/.env
39-
cp .env golang/vaas/pkg/authenticator/.env
40-
cp .env golang/vaas/pkg/vaas/.env
41-
cp .env golang/vaas/v3/.env
42-
cp .env golang/vaas/v3/examples/file-verdict-request/.env
43-
cp .env golang/vaas/v3/examples/vaasctl/.env
44-
cp .env golang/vaas/v3/pkg/vaas/.env
45-
cp .env golang/vaas/v3/pkg/authenticator/.env
46-
cp .env java/.env
47-
cp .env php/tests/vaas/.env
48-
cp .env ruby/test/.env
49-
cp .env shell/.env
20+
# Copies a `.env.wss` or `.env.https` file from the root directory to all
21+
# language directories. The `.env.wss` file is used for the WebSocket API,
22+
# while the `.env.https` file is used for the HTTP API.
23+
populate-env: populate-cpp-env \
24+
populate-rust-env \
25+
populate-ts-env \
26+
populate-dotnet-env \
27+
populate-go-env \
28+
populate-python-env \
29+
populate-php-env \
30+
populate-java-env \
31+
populate-shell-env
32+
33+
populate-cpp-env:
34+
mkdir -p cpp/build && cp .env.https cpp/build/.env
35+
36+
populate-rust-env:
37+
cp .env.wss rust/.env
38+
39+
populate-ts-env:
40+
cp .env.wss typescript/.env
41+
42+
populate-dotnet-env:
43+
cp .env.wss dotnet/.env
44+
45+
populate-go-env:
46+
cp .env.wss golang/vaas/.env
47+
cp .env.wss golang/vaas/v2/.env
48+
cp .env.wss golang/vaas/v2/examples/file-verdict-request/.env
49+
cp .env.wss golang/vaas/v2/examples/vaasctl/.env
50+
cp .env.wss golang/vaas/v2/pkg/vaas/.env
51+
cp .env.wss golang/vaas/v2/pkg/authenticator/.env
52+
cp .env.wss golang/vaas/pkg/authenticator/.env
53+
cp .env.wss golang/vaas/pkg/vaas/.env
54+
cp .env.wss golang/vaas/v3/.env
55+
cp .env.wss golang/vaas/v3/examples/file-verdict-request/.env
56+
cp .env.wss golang/vaas/v3/examples/vaasctl/.env
57+
cp .env.wss golang/vaas/v3/pkg/vaas/.env
58+
cp .env.wss golang/vaas/v3/pkg/authenticator/.env
59+
60+
populate-python-env:
61+
cp .env.wss python/.env
62+
63+
populate-php-env:
64+
cp .env.https php/tests/VaasTesting/.env
65+
66+
populate-java-env:
67+
cp .env.https java/.env
68+
69+
populate-shell-env:
70+
cp .env.wss shell/.env
5071

5172
############################################################
5273
# Commands for all languages at once.
5374
############################################################
5475

55-
build-all: build-rust build-ts build-dotnet build-go build-java build-ruby build-cpp
76+
build-all: build-rust build-ts build-dotnet build-go build-java build-cpp
5677

57-
test-all: test-rust test-ts test-dotnet test-go test-python test-php test-java test-ruby test-cpp
78+
test-all: test-rust test-ts test-dotnet test-go test-python test-php test-java test-cpp
5879

59-
clean-all: clean-rust clean-ts clean-dotnet clean-go clean-python clean-php clean-java clean-ruby clean-cpp
80+
clean-all: clean-rust clean-ts clean-dotnet clean-go clean-python clean-php clean-java clean-cpp
6081

6182
############################################################
6283
# Rust commands
@@ -157,13 +178,13 @@ release-python:
157178
############################################################
158179

159180
install-php:
160-
cd php/tests/vaas && composer install && cd -
181+
cd php/tests/VaasTesting && composer install && cd -
161182

162183
test-php: install-php
163-
cd php/tests/vaas && ./vendor/bin/phpunit --color --testdox && cd -
184+
cd php/tests/VaasTesting && ./vendor/bin/phpunit --color --testdox --exclude-group exclude && cd -
164185

165186
clean-php:
166-
cd php/tests/vaas && rm -rf vendor && cd -
187+
cd php/tests/VaasTesting && rm -rf vendor && cd -
167188

168189
release-php:
169190
git tag -a php{{version}} -m "Release PHP SDK {{version}}" && git push origin php{{version}}
@@ -186,26 +207,6 @@ release-java:
186207
git tag -a java{{version}} -m "Release Java SDK {{version}}" && git push origin java{{version}}
187208

188209

189-
############################################################
190-
# Ruby commands
191-
############################################################
192-
193-
build-ruby:
194-
cd ruby && gem build vaas.gemspec && cd -
195-
196-
install-ruby: build-ruby
197-
cd ruby && gem install --dev "vaas-0.0.1.gem" && cd -
198-
199-
test-ruby: install-ruby
200-
cd ruby/test && ruby vaas_test.rb && cd -
201-
202-
clean-ruby:
203-
cd ruby && gem clean && cd -
204-
205-
release-ruby:
206-
git tag -a rb{{version}} -m "Release Ruby SDK {{version}}" && git push origin rb{{version}}
207-
208-
209210
############################################################
210211
# C++ commands
211212
############################################################
@@ -258,10 +259,6 @@ alias bja := build-java
258259
alias tja := test-java
259260
alias cja := clean-java
260261

261-
alias brb := build-ruby
262-
alias trb := test-ruby
263-
alias crb := clean-ruby
264-
265262
alias bcp := build-cpp
266263
alias tcp := test-cpp
267264
alias ccp := clean-cpp

0 commit comments

Comments
 (0)