Skip to content

Commit f3ff5fb

Browse files
Update to Apodini 0.3.0 (#2)
1 parent 9909026 commit f3ff5fb

19 files changed

Lines changed: 406 additions & 88 deletions

.devcontainer/devcontainer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"--security-opt", "seccomp=unconfined"
77
],
88
"appPort": [
9-
8080
9+
80
1010
],
1111
"extensions": [
1212
"pvasek.sourcekit-lsp--dev-unofficial",

.github/pull_request_template.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# *Name of the PR*
2+
3+
## :recycle: Current situation
4+
*Describe the current situation (if possible with and exemplary (or real) code snippet and/or where this is used)*
5+
6+
## :bulb: Proposed solution
7+
*Describe the solution (if possible with and exemplary (or real) code snippet)*
8+
9+
### Problem that is solved
10+
*Provide a description and link issues that are solved*
11+
12+
### Implications
13+
*Describe the implications, e.g. refactoring*
14+
15+
## :heavy_plus_sign: Additional Information
16+
*Provide some additional information if possible*
17+
18+
### Related PRs
19+
*Reference the related PRs*
20+
21+
### Testing
22+
*Are there tests included? If yes, which situations are tested and which corner cases are missing?*
23+
24+
### Reviewer Nudging
25+
*Where should the reviewer start, where is a good entry point?*

.github/release-drafter.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
branches: [release]
2+
name-template: '$NEXT_PATCH_VERSION'
3+
tag-template: '$NEXT_PATCH_VERSION'
4+
categories:
5+
- title: '🚀 Features'
6+
labels:
7+
- 'feature'
8+
- 'enhancement'
9+
- title: '🐛 Bug Fixes'
10+
labels:
11+
- 'fix'
12+
- 'bugfix'
13+
- 'bug'
14+
- title: '🧰 Maintenance'
15+
label: 'chore'
16+
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
17+
template: |
18+
## Changes
19+
20+
$CHANGES

.github/workflows/build-and-test.yml

Lines changed: 25 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4,47 +4,45 @@ on:
44
push:
55
branches:
66
- develop
7-
- release
87
pull_request:
98
branches:
109
- develop
11-
- release
1210

1311
jobs:
14-
linux:
15-
name: Linux ${{ matrix.linux }} ${{ matrix.configuration }}
16-
container:
17-
image: swift:5.3-${{ matrix.linux }}
12+
macoswebservices:
13+
name: macOS
14+
runs-on: macos-11
15+
steps:
16+
- uses: actions/checkout@v2
17+
- uses: maxim-lobanov/setup-xcode@v1.1
18+
with:
19+
xcode-version: latest
20+
- name: Check Xcode version
21+
run: xcodebuild -version
22+
- name: Check Swift version
23+
run: swift --version
24+
- name: Build and test
25+
run: swift test
26+
linuxwebservices:
27+
name: Linux ${{ matrix.linux }}
1828
runs-on: ubuntu-latest
29+
container:
30+
image: swift:${{ matrix.linux }}
1931
strategy:
20-
fail-fast: false
2132
matrix:
22-
linux: [bionic, xenial, focal, amazonlinux2, centos8]
23-
configuration: [debug, release, release_testing]
33+
linux: [focal, bionic, amazonlinux2, centos8]
2434
steps:
2535
- uses: actions/checkout@v2
26-
- name: Install libsqlite3, lsof and zsh
36+
- name: Install libsqlite3
2737
if: ${{ !(startsWith( matrix.linux, 'centos' ) || startsWith( matrix.linux, 'amazonlinux' )) }}
28-
run: apt-get update && apt-get install -y --no-install-recommends libsqlite3-dev lsof zsh
38+
run: apt-get update && apt-get install -y --no-install-recommends libsqlite3-dev
2939
- name: Install libsqlite3
3040
if: startsWith( matrix.linux, 'amazonlinux' )
31-
run: yum update -y && yum install -y sqlite-devel lsof zsh
41+
run: yum update -y && yum install -y sqlite-devel
3242
- name: Install libsqlite3
3343
if: startsWith( matrix.linux, 'centos' )
34-
run: yum update -y --nobest && yum install -y sqlite-devel lsof zsh
35-
- uses: actions/cache@v2
36-
with:
37-
path: .build
38-
key: ${{ runner.os }}-${{matrix.linux}}-spm-${{ hashFiles('Package.resolved') }}
44+
run: yum update -y --nobest && yum install -y sqlite-devel
3945
- name: Check Swift version
4046
run: swift --version
41-
42-
- name: Release Build # Ensuring release build runs successfully without -enable-testing flag
43-
if: matrix.configuration == 'release'
44-
run: swift build -c release
45-
- name: Release Build & Test
46-
if: matrix.configuration == 'release_testing'
47-
run: swift test -c release --enable-test-discovery -Xswiftc -enable-testing -Xswiftc -DRELEASE_TESTING
48-
- name: Debug Build & Test
49-
if: matrix.configuration == 'debug'
50-
run: swift test -c debug --enable-test-discovery
47+
- name: Build and test
48+
run: swift test -Xswiftc -Xfrontend -Xswiftc -sil-verify-none
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Build Docker Compose
2+
3+
on:
4+
push:
5+
branches:
6+
- develop
7+
pull_request:
8+
branches:
9+
- develop
10+
11+
jobs:
12+
dockercompose:
13+
name: Docker Compose Build and Test
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v2
18+
- name: Start containers
19+
run: docker-compose -f docker-compose-development.yml up -d --build
20+
- name: Test web service
21+
run: |
22+
sleep 3
23+
curl --fail http://localhost/v1/
24+
- name: Stop containers
25+
if: always()
26+
run: docker-compose down

.github/workflows/docker.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Build Docker Image
2+
3+
on:
4+
push:
5+
tags:
6+
- '*.*.*'
7+
8+
jobs:
9+
docker:
10+
name: Docker Build and Push Image
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@v2
15+
- name: Get latest tag
16+
id: latesttag
17+
uses: WyriHaximus/github-action-get-previous-tag@v1
18+
with:
19+
fallback: latest
20+
- name: Set up QEMU
21+
uses: docker/setup-qemu-action@v1
22+
- name: Set up docker buildx
23+
uses: docker/setup-buildx-action@v1
24+
with:
25+
install: true
26+
- name: Log in to the container registry
27+
uses: docker/login-action@v1
28+
with:
29+
registry: ghcr.io
30+
username: ${{ github.actor }}
31+
password: ${{ secrets.GITHUB_TOKEN }}
32+
- name: Build and push docker image
33+
id: buildandpush
34+
uses: docker/build-push-action@v2
35+
with:
36+
context: .
37+
file: ./Dockerfile
38+
push: true
39+
tags: ghcr.io/apodini/template:latest,ghcr.io/apodini/template:${{ steps.latesttag.outputs.tag }}
40+
- name: Image digest
41+
run: echo ${{ steps.buildandpush.outputs.digest }}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: Release Drafter
2+
3+
on:
4+
push:
5+
branches:
6+
- release
7+
8+
jobs:
9+
update_release_draft:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: release-drafter/release-drafter@v5
13+
env:
14+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/release.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Create Release
2+
3+
on:
4+
push:
5+
tags:
6+
- '*.*.*'
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: GH Release
13+
uses: softprops/action-gh-release@v0.1.5
14+
env:
15+
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}

.github/workflows/swiftlint.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
name: SwiftLint
22

3-
on: pull_request
3+
on:
4+
pull_request:
5+
paths:
6+
- '.github/workflows/swiftlint.yml'
7+
- '.swiftlint.yml'
8+
- '**/*.swift'
49

510
jobs:
611
swiftlint:
@@ -11,3 +16,5 @@ jobs:
1116
uses: norio-nomura/action-swiftlint@3.2.1
1217
with:
1318
args: --strict
19+
env:
20+
DIFF_BASE: ${{ github.base_ref }}

.vscode/tasks.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
{
55
"label": "build",
66
"type": "shell",
7-
"command": "swift build",
7+
"command": "swift build -Xswiftc -Xfrontend -Xswiftc -sil-verify-none",
88
"group": {
99
"kind": "build",
1010
"isDefault": true
@@ -16,7 +16,7 @@
1616
{
1717
"label": "buildtests",
1818
"type": "shell",
19-
"command": "swift build --build-tests --enable-test-discovery"
19+
"command": "swift build -Xswiftc -Xfrontend -Xswiftc -sil-verify-none --build-tests"
2020
}
2121
]
22-
}
22+
}

0 commit comments

Comments
 (0)