-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
171 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
ARG SWIFT_VERSION | ||
|
||
FROM swift:${SWIFT_VERSION} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
{ | ||
"name": "Swift", | ||
"build": { | ||
"dockerfile": "Dockerfile", | ||
"args": { | ||
"SWIFT_VERSION" : "5.8" | ||
} | ||
}, | ||
"features": { | ||
"ghcr.io/devcontainers/features/common-utils:2": { | ||
"installZsh": "false", | ||
"username": "vscode", | ||
"userUid": "1000", | ||
"userGid": "1000", | ||
"upgradePackages": "false" | ||
}, | ||
"ghcr.io/devcontainers/features/git:1": { | ||
"version": "os-provided", | ||
"ppa": "false" | ||
} | ||
}, | ||
"runArgs": [ | ||
"--cap-add=SYS_PTRACE", | ||
"--security-opt", | ||
"seccomp=unconfined" | ||
], | ||
// Configure tool-specific properties. | ||
"customizations": { | ||
// Configure properties specific to VS Code. | ||
"vscode": { | ||
// Set *default* container specific settings.json values on container create. | ||
"settings": { | ||
"lldb.library": "/usr/lib/liblldb.so" | ||
}, | ||
// Add the IDs of extensions you want installed when the container is created. | ||
"extensions": [ | ||
"sswg.swift-lang" | ||
] | ||
} | ||
}, | ||
// Use 'forwardPorts' to make a list of ports inside the container available locally. | ||
// "forwardPorts": [], | ||
|
||
// Set `remoteUser` to `root` to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. | ||
"remoteUser": "vscode" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
--- | ||
name: Build and test | ||
|
||
"on": | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: ["**"] | ||
|
||
jobs: | ||
|
||
devcontainer: | ||
name: "Devcontainer: ${{ matrix.os }}/${{ matrix.configuration }}" | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] | ||
configuration: [debug] | ||
|
||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
show-progress: false | ||
|
||
- name: Build and Test | ||
uses: devcontainers/[email protected] | ||
with: | ||
runCmd: swift test --explicit-target-dependency-import-check=error -c ${{ matrix.configuration }} | ||
|
||
xcode: | ||
runs-on: macos-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
show-progress: false | ||
|
||
- name: Build and Test | ||
run: xcrun xcodebuild -skipPackagePluginValidation -scheme Lotsawa -destination 'platform=macOS' test | ||
|
||
native: | ||
name: "Native: ${{ matrix.os }}/${{ matrix.configuration }}" | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [macos-latest, ubuntu-latest, windows-latest] | ||
|
||
configuration: [debug] | ||
|
||
include: | ||
# Default values to add | ||
- shell: 'bash -eo pipefail {0}' | ||
- build-options: '--explicit-target-dependency-import-check=error' | ||
|
||
# Overrides for the defaults | ||
- shell: pwsh | ||
os: windows-latest | ||
|
||
runs-on: ${{ matrix.os }} | ||
|
||
defaults: | ||
run: | ||
shell: ${{ matrix.shell }} | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
show-progress: false | ||
|
||
|
||
- name: Setup Swift (Unices) | ||
if: ${{ matrix.os != 'windows-latest' }} | ||
uses: 'swift-actions/setup-swift@v1' | ||
with: | ||
version: 5.9 | ||
|
||
- name: Setup Swift (Windows) | ||
if: ${{ matrix.os == 'windows-latest' }} | ||
uses: 'compnerd/gha-setup-swift@main' | ||
with: | ||
github-repo: thebrowsercompany/swift-build | ||
release-asset-name: installer-amd64.exe | ||
release-tag-name: 20231010.3 | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build and Test (${{ matrix.configuration }}) | ||
run: > | ||
swift test -c ${{ matrix.configuration }} ${{ matrix.build-options }} | ||
--explicit-target-dependency-import-check=error |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Code Coverage | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ "**" ] | ||
|
||
jobs: | ||
|
||
codecov: | ||
runs-on: macos-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
show-progress: false | ||
|
||
|
||
- name: Test and generate code coverage report | ||
run: xcrun xcodebuild -skipPackagePluginValidation -enableCodeCoverage YES -scheme Lotsawa -destination 'platform=macOS' test | ||
|
||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v3 | ||
with: | ||
env_vars: OS | ||
fail_ci_if_error: true | ||
flags: unittests | ||
swift: true | ||
name: codecov-umbrella | ||
verbose: true |
This file was deleted.
Oops, something went wrong.