Skip to content

Commit 688ba4f

Browse files
committed
feat(docs): Include guide on CircleCI
1 parent 84c79ec commit 688ba4f

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed

docs/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,6 @@ Integrations
3232
integrations/heroku
3333
integrations/travis-ci
3434
integrations/gitlab-ci
35+
integrations/circle-ci
3536
integrations/docker
3637
integrations/cocoapods

docs/integrations/circle-ci.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# CircleCI
2+
3+
You can use swiftenv in conjunction with Docker on
4+
[CircleCI](https://circleci.com) to easily test your Swift project on CircleCI.
5+
6+
**NOTE:** *These instructions only cover using CircleCI on Linux and do not
7+
apply to CircleCI macOS containers.*
8+
9+
### `Dockerfile`
10+
11+
A `Dockerfile` may contain the instructions to build a docker container
12+
containing swiftenv, Swift and your source code.
13+
14+
The following `Dockerfile` shows an example of setting up swiftenv and
15+
installing the version of Swift found in `.swift-version`.
16+
17+
You may also base your image on top of `kylef/swiftenv:swift3` or
18+
`kylef/swiftenv:swift` to use pre-installed Swift versions.
19+
20+
```
21+
FROM kylef/swiftenv
22+
23+
RUN mkdir -p /code
24+
WORKDIR /code
25+
ADD . /code
26+
27+
RUN swiftenv install
28+
```
29+
30+
### `circle.yml`
31+
32+
Using a `circle.yml` file we can instruct CircleCI to build and run `swift
33+
test` inside our docker container.
34+
35+
```yaml
36+
machine:
37+
services: docker
38+
39+
dependencies:
40+
override: docker build -t myapp .
41+
42+
test:
43+
override: docker run myapp swift test
44+
```

0 commit comments

Comments
 (0)