This commit is contained in:
1
.dockerignore
Normal file
1
.dockerignore
Normal file
@@ -0,0 +1 @@
|
|||||||
|
.build/*
|
||||||
21
.gitea/workflows/ci.yml
Normal file
21
.gitea/workflows/ci.yml
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
---
|
||||||
|
name: CI
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: ["main"]
|
||||||
|
pull_request:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
name: Run tests.
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Setup just.
|
||||||
|
uses: extractions/setup-just@v2
|
||||||
|
- name: Setup QEMU
|
||||||
|
uses: docker/setup-qemu-action@v3
|
||||||
|
- name: Setup Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
- name: Run tests.
|
||||||
|
run: just test-docker
|
||||||
8
docker/Dockerfile.test
Normal file
8
docker/Dockerfile.test
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
ARG SWIFT_IMAGE_VERSION="6.0"
|
||||||
|
FROM swift:${SWIFT_IMAGE_VERSION}
|
||||||
|
WORKDIR /app
|
||||||
|
COPY ./Package.* ./
|
||||||
|
RUN swift package resolve
|
||||||
|
COPY . .
|
||||||
|
RUN swift build
|
||||||
|
CMD ["/bin/bash", "-xc", "swift", "test"]
|
||||||
10
justfile
10
justfile
@@ -1,3 +1,4 @@
|
|||||||
|
docker_image_name := "clidoc"
|
||||||
|
|
||||||
[private]
|
[private]
|
||||||
default:
|
default:
|
||||||
@@ -6,6 +7,15 @@ default:
|
|||||||
clean:
|
clean:
|
||||||
@rm -rf .build
|
@rm -rf .build
|
||||||
|
|
||||||
|
test-docker: build-docker
|
||||||
|
@docker run -t --rm {{docker_image_name}}:test swift test
|
||||||
|
|
||||||
|
build-docker:
|
||||||
|
@docker build \
|
||||||
|
--file docker/Dockerfile.test \
|
||||||
|
--tag {{docker_image_name}}:test \
|
||||||
|
.
|
||||||
|
|
||||||
preview-documentation target="CliDoc":
|
preview-documentation target="CliDoc":
|
||||||
# using the --enable-experimental-combined-documentation doesn't work in previews currently.
|
# using the --enable-experimental-combined-documentation doesn't work in previews currently.
|
||||||
@swift package \
|
@swift package \
|
||||||
|
|||||||
Reference in New Issue
Block a user