Skip to content

Commit d268a35

Browse files
committed
Add Dockerfiles for testing
1 parent bb766ae commit d268a35

File tree

4 files changed

+90
-0
lines changed

4 files changed

+90
-0
lines changed

docker/Dockerfile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
ARG swift_version=5.7
2+
ARG ubuntu_version=jammy
3+
ARG base_image=swift:$swift_version-$ubuntu_version
4+
FROM $base_image
5+
# needed to do again after FROM due to docker limitation
6+
ARG swift_version
7+
ARG ubuntu_version
8+
9+
# set as UTF-8
10+
RUN apt-get update && apt-get install -y locales locales-all
11+
ENV LC_ALL en_US.UTF-8
12+
ENV LANG en_US.UTF-8
13+
ENV LANGUAGE en_US.UTF-8
14+
15+
# dependencies
16+
# RUN apt-get update && apt-get install -y wget
17+
18+
# tools
19+
RUN mkdir -p $HOME/.tools
20+
RUN echo 'export PATH="$HOME/.tools:$PATH"' >> $HOME/.profile

docker/docker-compose.2204.57.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
version: "3"
2+
3+
services:
4+
5+
runtime-setup:
6+
image: webauthn-swift:22.04-5.7
7+
build:
8+
args:
9+
ubuntu_version: "jammy"
10+
swift_version: "5.7"
11+
12+
test:
13+
image: webauthn-swift:22.04-5.7
14+
environment: []
15+
#- SANITIZER_ARG=--sanitize=thread
16+
17+
shell:
18+
image: webauthn-swift:22.04-5.7

docker/docker-compose.2204.main.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
version: "3"
2+
3+
services:
4+
5+
runtime-setup:
6+
image: webauthn-swift:22.04-main
7+
build:
8+
args:
9+
base_image: "swiftlang/swift:nightly-main-focal"
10+
11+
test:
12+
image: webauthn-swift:22.04-main
13+
environment:
14+
- IMPORT_CHECK_ARG=--explicit-target-dependency-import-check error
15+
#- SANITIZER_ARG=--sanitize=thread
16+
17+
shell:
18+
image: webauthn-swift:22.04-main

docker/docker-compose.yaml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# this file is not designed to be run directly
2+
# instead, use the docker-compose.<os>.<swift> files
3+
# eg docker-compose -f docker/docker-compose.yaml -f docker/docker-compose.1804.50.yaml run test
4+
version: "3"
5+
6+
services:
7+
8+
runtime-setup:
9+
image: webauthn-swift:default
10+
build:
11+
context: .
12+
dockerfile: Dockerfile
13+
14+
common: &common
15+
image: webauthn-swift:default
16+
depends_on: [runtime-setup]
17+
volumes:
18+
- ~/.ssh:/root/.ssh
19+
- ..:/code:z
20+
working_dir: /code
21+
22+
soundness:
23+
<<: *common
24+
command: /bin/bash -xcl "./scripts/soundness.sh"
25+
26+
test:
27+
<<: *common
28+
command: /bin/bash -xcl "swift test --parallel -Xswiftc -warnings-as-errors --enable-test-discovery $${SANITIZER_ARG-} $${IMPORT_CHECK_ARG-}"
29+
30+
# util
31+
32+
shell:
33+
<<: *common
34+
entrypoint: /bin/bash

0 commit comments

Comments
 (0)