feat: Adds ci
Some checks failed
CI / Run tests. (push) Failing after 31s

This commit is contained in:
2024-12-07 09:48:45 -05:00
parent 45ab7ca578
commit 6b670ce5c4
4 changed files with 40 additions and 0 deletions

1
.dockerignore Normal file
View File

@@ -0,0 +1 @@
.build/*

21
.gitea/workflows/ci.yml Normal file
View 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
View 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"]

View File

@@ -1,3 +1,4 @@
docker_image_name := "clidoc"
[private]
default:
@@ -6,6 +7,15 @@ default:
clean:
@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":
# using the --enable-experimental-combined-documentation doesn't work in previews currently.
@swift package \