2929 name : Test
3030 runs-on : ubuntu-latest
3131 container :
32- image : registry.gitlab.com/finestructure/spi-base:1.1.1
32+ image : registry.gitlab.com/finestructure/spi-base:1.2.0
3333 options : --privileged
34- services :
35- postgres :
36- image : postgres:16-alpine
37- env :
38- POSTGRES_DB : spi_test
39- POSTGRES_USER : spi_test
40- POSTGRES_PASSWORD : xxx
41- ports :
42- - ' 5432:5432'
43- options : >-
44- --health-cmd pg_isready
45- --health-interval 10s
46- --health-timeout 5s
47- --health-retries 5
4834 steps :
4935 - name : GH Runner bug workaround
5036 run : sysctl -w vm.mmap_rnd_bits=28
@@ -57,23 +43,118 @@ jobs:
5743 run : cp .env.testing.template .env.testing && make test
5844 env :
5945 COLLECTION_SIGNING_PRIVATE_KEY : ${{ secrets.COLLECTION_SIGNING_PRIVATE_KEY }}
60- DATABASE_HOST : postgres
61- DATABASE_PORT : ' 5432'
46+ services :
47+ spi_test_0 :
48+ image : postgres:16-alpine
49+ env :
50+ POSTGRES_DB : spi_test
51+ POSTGRES_USER : spi_test
52+ POSTGRES_PASSWORD : xxx
53+ options : >-
54+ --health-cmd pg_isready
55+ --health-interval 10s
56+ --health-timeout 5s
57+ --health-retries 5
58+ spi_test_1 :
59+ image : postgres:16-alpine
60+ env :
61+ POSTGRES_DB : spi_test
62+ POSTGRES_USER : spi_test
63+ POSTGRES_PASSWORD : xxx
64+ options : >-
65+ --health-cmd pg_isready
66+ --health-interval 10s
67+ --health-timeout 5s
68+ --health-retries 5
69+ spi_test_2 :
70+ image : postgres:16-alpine
71+ env :
72+ POSTGRES_DB : spi_test
73+ POSTGRES_USER : spi_test
74+ POSTGRES_PASSWORD : xxx
75+ options : >-
76+ --health-cmd pg_isready
77+ --health-interval 10s
78+ --health-timeout 5s
79+ --health-retries 5
80+ spi_test_3 :
81+ image : postgres:16-alpine
82+ env :
83+ POSTGRES_DB : spi_test
84+ POSTGRES_USER : spi_test
85+ POSTGRES_PASSWORD : xxx
86+ options : >-
87+ --health-cmd pg_isready
88+ --health-interval 10s
89+ --health-timeout 5s
90+ --health-retries 5
91+ spi_test_4 :
92+ image : postgres:16-alpine
93+ env :
94+ POSTGRES_DB : spi_test
95+ POSTGRES_USER : spi_test
96+ POSTGRES_PASSWORD : xxx
97+ options : >-
98+ --health-cmd pg_isready
99+ --health-interval 10s
100+ --health-timeout 5s
101+ --health-retries 5
102+ spi_test_5 :
103+ image : postgres:16-alpine
104+ env :
105+ POSTGRES_DB : spi_test
106+ POSTGRES_USER : spi_test
107+ POSTGRES_PASSWORD : xxx
108+ options : >-
109+ --health-cmd pg_isready
110+ --health-interval 10s
111+ --health-timeout 5s
112+ --health-retries 5
113+ spi_test_6 :
114+ image : postgres:16-alpine
115+ env :
116+ POSTGRES_DB : spi_test
117+ POSTGRES_USER : spi_test
118+ POSTGRES_PASSWORD : xxx
119+ options : >-
120+ --health-cmd pg_isready
121+ --health-interval 10s
122+ --health-timeout 5s
123+ --health-retries 5
124+ spi_test_7 :
125+ image : postgres:16-alpine
126+ env :
127+ POSTGRES_DB : spi_test
128+ POSTGRES_USER : spi_test
129+ POSTGRES_PASSWORD : xxx
130+ options : >-
131+ --health-cmd pg_isready
132+ --health-interval 10s
133+ --health-timeout 5s
134+ --health-retries 5
62135
63136 release-build-linux :
64137 name : Release build
65138 runs-on : ubuntu-latest
66139 container :
67- image : registry.gitlab.com/finestructure/spi-base:1.1.1
140+ image : registry.gitlab.com/finestructure/spi-base:1.2.0
68141 options : --privileged
69142 steps :
70143 - name : GH Runner bug workaround
71144 run : sysctl -w vm.mmap_rnd_bits=28
72145 - name : Checkout code
73146 uses : actions/checkout@v4
74147 with : { 'fetch-depth': 0 }
75- - name : Build release
76- run : swift build -c release --static-swift-stdlib -Xlinker -ljemalloc
148+ - name : Test release
149+ run : |
150+ # Since we're only pinging the version api endpoint, no database is needed and
151+ # we can just copy the development template to ensure the db env variables are set.
152+ cp .env.development.template .env.development
153+ swift build -c release --static-swift-stdlib -Xlinker -ljemalloc
154+ $(swift build --show-bin-path -c release)/Run serve --port 8080 --hostname 0.0.0.0 &
155+ sleep 10
156+ echo Probing api/version...
157+ bash -c '[ "$(curl -sL -w "%{http_code}" -o /dev/null http://127.0.0.1:8080/api/version)" == "200" ] || (echo Connection failed ; exit 1)'
77158
78159 # test-macos:
79160 # name: Test macOS
85166 # POSTGRES_DB: spi_dev
86167 # POSTGRES_USER: spi_dev
87168 # POSTGRES_PASSWORD: xxx
88- # ports:
89- # - 5432:5432
90169 # options: >-
91170 # --health-cmd pg_isready
92171 # --health-interval 10s
0 commit comments