Skip to content

Commit

Permalink
CI, Test Scripts, and README Improvements (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
PSchmiedmayer authored Dec 21, 2021
1 parent 6aee90a commit 86c0f5d
Show file tree
Hide file tree
Showing 17 changed files with 393 additions and 188 deletions.
33 changes: 33 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<!--
This source file is part of the FA 2021 open source project
SPDX-FileCopyrightText: 2021 Paul Schmiedmayer and the FA 2021 project authors (see CONTRIBUTORS.md) <[email protected]>
SPDX-License-Identifier: MIT
-->

# *Name of the PR*

## :recycle: Current situation & Problem
*Describe the current situation (if possible with and exemplary (or real) code snippet and/or where this is used)*

## :bulb: Proposed solution
*Describe the solution and how this affects the project and internal structure*

## :gear: Release Notes
*Add a short summary of the feature as well as possible migration guides if this is a breaking change so this section can be added to the release notes.*
*Include code snippets that provide examples of the feature implemented if it appends or changes the public interface.*

## :heavy_plus_sign: Additional Information
*Provide some additional information if possible*

### Related PRs
*Reference the related PRs*

### Testing
*Are there tests included? If yes, which situations are tested and which corner cases are missing?*

### Reviewer Nudging
*Where should the reviewer start, where is a good entry point?*
23 changes: 9 additions & 14 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# This source file is part of the FA2021 open source project
#
# SPDX-FileCopyrightText: 2019-2021 Paul Schmiedmayer and the project authors (see CONTRIBUTORS.md) <[email protected]>
# This source file is part of the FA 2021 open source project
#
# SPDX-FileCopyrightText: 2021 Paul Schmiedmayer and the FA 2021 project authors (see CONTRIBUTORS.md) <[email protected]>
#
# SPDX-License-Identifier: MIT
#
Expand Down Expand Up @@ -38,12 +38,8 @@ jobs:
run: xcodebuild -version
- name: Check Swift version
run: swift --version
- name: Release Build # Ensuring release build runs successfully without -enable-testing flag
if: matrix.configuration == 'release'
run: swift build -c release
- name: Debug Build
if: matrix.configuration == 'debug'
run: swift build -c debug
- name: Build ${{ matrix.configuration }}
run: swift build -c ${{ matrix.configuration }}

linux:
name: Linux ${{ matrix.linux }} ${{ matrix.configuration }}
Expand All @@ -53,8 +49,8 @@ jobs:
strategy:
fail-fast: false
matrix:
linux: [bionic, focal, amazonlinux2, centos8]
configuration: [debug, release, release_testing]
linux: [focal, amazonlinux2, centos8]
configuration: [debug, release]
steps:
- uses: actions/checkout@v2
- name: Install libsqlite3, lsof, zsh and libavahi-compat-libdnssd-dev
Expand All @@ -75,6 +71,5 @@ jobs:
key: ${{ runner.os }}-${{matrix.linux}}-${{matrix.configuration}}-spm2-${{ hashFiles('Package.resolved') }}
- name: Check Swift version
run: swift --version
- name: Release Build # Ensuring release build runs successfully without -enable-testing flag
if: matrix.configuration == 'release'
run: swift build -c release
- name: Build ${{ matrix.configuration }}
run: swift build -c ${{ matrix.configuration }}
102 changes: 85 additions & 17 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# This source file is part of the Apodini Template open source project
# This source file is part of the FA 2021 open source project
#
# SPDX-FileCopyrightText: 2021 Paul Schmiedmayer and the project authors (see CONTRIBUTORS.md) <[email protected]>
# SPDX-FileCopyrightText: 2021 Paul Schmiedmayer and the FA 2021 project authors (see CONTRIBUTORS.md) <[email protected]>
#
# SPDX-License-Identifier: MIT
#
Expand All @@ -14,9 +14,9 @@ on:
workflow_dispatch:

jobs:
docker:
name: Docker Build and Push Image ${{ matrix.architecture }}
runs-on: ubuntu-latest
dockerARM64:
name: Docker Build and Push ARM64 Images
runs-on: ARM64
steps:
- name: Checkout repository
uses: actions/checkout@v2
Expand All @@ -25,28 +25,96 @@ jobs:
uses: WyriHaximus/github-action-get-previous-tag@v1
with:
fallback: latest
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Log in to the container registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push web service docker image
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
build-args: |
baseimage=swiftarm/swift:5.5.1-ubuntu-focal
push: true
tags: ghcr.io/fa21-collaborative-drone-interactions/buoy-webservice:latest-arm64,ghcr.io/fa21-collaborative-drone-interactions/buoy-webservice:${{ steps.latesttag.outputs.tag }}-arm64
- name: Build and push Buoy Post Discovery Action docker image
uses: docker/build-push-action@v2
with:
platforms: linux/arm64
- name: Set up docker buildx
uses: docker/setup-buildx-action@v1
context: ./BuoyPostDiscoveryAction
file: ./BuoyPostDiscoveryAction/Dockerfile
push: true
tags: ghcr.io/fa21-collaborative-drone-interactions/buoy-post-discovery-action:latest-arm64,ghcr.io/fa21-collaborative-drone-interactions/buoy-post-discovery-action:${{ steps.latesttag.outputs.tag }}-arm64
dockerAMD64:
name: Docker Build and Push AMD64 Images
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Get latest tag
id: latesttag
uses: WyriHaximus/github-action-get-previous-tag@v1
with:
install: true
fallback: latest
- name: Log in to the container registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push docker image
id: buildandpush
- name: Build and push web service docker image
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
build-args: |
baseimage=swift:focal
push: true
tags: ghcr.io/fa21-collaborative-drone-interactions/buoy-webservice:latest-amd64,ghcr.io/fa21-collaborative-drone-interactions/buoy-webservice:${{ steps.latesttag.outputs.tag }}-amd64
- name: Build and push Buoy Post Discovery Action docker image
uses: docker/build-push-action@v2
with:
context: ./BuoyPostDiscoveryAction
file: ./BuoyPostDiscoveryAction/Dockerfile
push: true
platforms: linux/arm64
tags: ghcr.io/fa21-collaborative-drone-interactions/buoy-webservice:latest
- name: Image digest
run: echo ${{ steps.buildandpush.outputs.digest }}
tags: ghcr.io/fa21-collaborative-drone-interactions/buoy-post-discovery-action:latest-amd64,ghcr.io/fa21-collaborative-drone-interactions/buoy-post-discovery-action:${{ steps.latesttag.outputs.tag }}-amd64
dockermanifest:
needs: [dockerARM64, dockerAMD64]
name: Create Multi-CPU Architecture Image
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Get latest tag
id: latesttag
uses: WyriHaximus/github-action-get-previous-tag@v1
with:
fallback: latest
- name: Log in to the container registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Create and Push web service Multi Architecture Image
run: |
docker manifest create ghcr.io/fa21-collaborative-drone-interactions/buoy-webservice:latest \
--amend ghcr.io/fa21-collaborative-drone-interactions/buoy-webservice:latest-amd64 \
--amend ghcr.io/fa21-collaborative-drone-interactions/buoy-webservice:latest-arm64
docker manifest create ghcr.io/fa21-collaborative-drone-interactions/buoy-webservice:${{ steps.latesttag.outputs.tag }} \
--amend ghcr.io/fa21-collaborative-drone-interactions/buoy-webservice:${{ steps.latesttag.outputs.tag }}-amd64 \
--amend ghcr.io/fa21-collaborative-drone-interactions/buoy-webservice:${{ steps.latesttag.outputs.tag }}-arm64
docker manifest push ghcr.io/fa21-collaborative-drone-interactions/buoy-webservice:latest
docker manifest push ghcr.io/fa21-collaborative-drone-interactions/buoy-webservice:${{ steps.latesttag.outputs.tag }}
- name: Create and Push Buoy Post Discovery Action Multi Architecture Image
run: |
docker manifest create ghcr.io/fa21-collaborative-drone-interactions/buoy-post-discovery-action:latest \
--amend ghcr.io/fa21-collaborative-drone-interactions/buoy-post-discovery-action:latest-amd64 \
--amend ghcr.io/fa21-collaborative-drone-interactions/buoy-post-discovery-action:latest-arm64
docker manifest create ghcr.io/fa21-collaborative-drone-interactions/buoy-post-discovery-action:${{ steps.latesttag.outputs.tag }} \
--amend ghcr.io/fa21-collaborative-drone-interactions/buoy-post-discovery-action:${{ steps.latesttag.outputs.tag }}-amd64 \
--amend ghcr.io/fa21-collaborative-drone-interactions/buoy-post-discovery-action:${{ steps.latesttag.outputs.tag }}-arm64
docker manifest push ghcr.io/fa21-collaborative-drone-interactions/buoy-post-discovery-action:latest
docker manifest push ghcr.io/fa21-collaborative-drone-interactions/buoy-post-discovery-action:${{ steps.latesttag.outputs.tag }}
23 changes: 0 additions & 23 deletions .github/workflows/release.yml

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/reuseaction.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# This source file is part of the FA2021 open source project
# This source file is part of the FA 2021 open source project
#
# SPDX-FileCopyrightText: 2019-2021 Paul Schmiedmayer and the project authors (see CONTRIBUTORS.md) <[email protected]>
# SPDX-FileCopyrightText: 2021 Paul Schmiedmayer and the FA 2021 project authors (see CONTRIBUTORS.md) <[email protected]>
#
# SPDX-License-Identifier: MIT
#
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/spm-update.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# This source file is part of the FA2021 open source project
# This source file is part of the FA 2021 open source project
#
# SPDX-FileCopyrightText: 2019-2021 Paul Schmiedmayer and the project authors (see CONTRIBUTORS.md) <[email protected]>
# SPDX-FileCopyrightText: 2021 Paul Schmiedmayer and the FA 2021 project authors (see CONTRIBUTORS.md) <[email protected]>
#
# SPDX-License-Identifier: MIT
#
Expand Down Expand Up @@ -37,4 +37,4 @@ jobs:
assignees: ApodiniBot
committer: ApodiniBot <[email protected]>
author: ApodiniBot <[email protected]>
reviewers: hendesi
reviewers: PSchmiedmayer
4 changes: 2 additions & 2 deletions .github/workflows/swiftlint.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# This source file is part of the FA2021 open source project
# This source file is part of the FA 2021 open source project
#
# SPDX-FileCopyrightText: 2019-2021 Paul Schmiedmayer and the project authors (see CONTRIBUTORS.md) <[email protected]>
# SPDX-FileCopyrightText: 2021 Paul Schmiedmayer and the FA 2021 project authors (see CONTRIBUTORS.md) <[email protected]>
#
# SPDX-License-Identifier: MIT
#
Expand Down
File renamed without changes.
File renamed without changes.
10 changes: 3 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,12 @@
# SPDX-License-Identifier: MIT
#

# ARG baseimage=swift:focal
ARG baseimage=swift:focal

# ================================
# Build image
# ================================
# FROM swiftlang/swift@sha256:59fd39504339a0c0b24a304bb50028ff679bf60b45f25f6acd42b0530a1188c6 as build
# FROM ${baseimage} as build
FROM swiftarm/swift:5.5.1-ubuntu-focal as build
FROM ${baseimage} as build

# Install OS updates and, if needed, sqlite3
RUN export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true \
Expand Down Expand Up @@ -47,9 +45,7 @@ RUN [ -d "$(swift build --package-path /build --show-bin-path)/WebService.resour
# ================================
# Run image
# ================================
# FROM swiftlang/swift@sha256:59fd39504339a0c0b24a304bb50028ff679bf60b45f25f6acd42b0530a1188c6 as run
# FROM ${baseimage} as run
FROM swiftarm/swift:5.5.1-ubuntu-focal as run
FROM ${baseimage}-slim as run

# Make sure all system packages are up to date.
RUN export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true \
Expand Down
Loading

0 comments on commit 86c0f5d

Please sign in to comment.