-
-
Notifications
You must be signed in to change notification settings - Fork 320
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: order for
XCLocalSwiftPackageReference
and `XCRemoteSwiftPacka…
…geReference` (#855) * Flip the order of `XCLocalSwiftPackageReference` and `XCRemoteSwiftPackageReference` * Add tasks to run tests and build the package in Linux from a macOS environment using Podman * Install Swift in the Linux environments * Remove Tests/LinuxMain.swift * Build and test in a virtualized Linux container from the macOS environment * Set up Docker * Install Podman * Initialize the machine before starting it * Run from ubuntu-latest --------- Co-authored-by: Pedro <[email protected]>
- Loading branch information
Showing
9 changed files
with
102 additions
and
79 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 |
---|---|---|
|
@@ -20,42 +20,34 @@ jobs: | |
runs-on: macos-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: maxim-lobanov/setup-xcode@v1 | ||
with: | ||
xcode-version: latest-stable | ||
- uses: jdx/mise-action@v2 | ||
- name: Build | ||
run: swift build -c release | ||
run: mise run build | ||
build-linux: | ||
name: Build (Linux) | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: jdx/mise-action@v2 | ||
- name: Build | ||
run: swift build -c release | ||
run: mise run build-linux | ||
test: | ||
name: Test (macOS / Xcode) | ||
runs-on: macos-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: maxim-lobanov/setup-xcode@v1 | ||
with: | ||
xcode-version: latest-stable | ||
- uses: jdx/mise-action@v2 | ||
- name: Run tests | ||
run: swift test --enable-code-coverage | ||
- name: Send test coverage report | ||
run: bash <(curl -s https://codecov.io/bash) | ||
run: mise run test | ||
|
||
test-linux: | ||
name: Test (Linux) | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set Git config | ||
run: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "xcodeproj" | ||
git config --global init.defaultBranch main | ||
- name: Build and run tests | ||
run: swift test --enable-test-discovery | ||
- uses: jdx/mise-action@v2 | ||
- name: Test | ||
run: mise run test-linux | ||
|
||
lint: | ||
name: Lint | ||
|
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 |
---|---|---|
|
@@ -2,4 +2,5 @@ | |
swiftformat = "0.54.3" | ||
tuist = "4.27.0" | ||
swiftlint = "0.55.1" | ||
swift="5.10.1" | ||
"git-cliff" = "2.4.0" |
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 @@ | ||
#!/usr/bin/env bash | ||
# mise description="Build the package in the host" | ||
|
||
swift build --package-path $MISE_PROJECT_ROOT --configuration debug |
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,16 @@ | ||
#!/usr/bin/env bash | ||
# mise description="Build on Linux" | ||
|
||
CONTAINER_RUNTIME=$(command -v podman || command -v docker) | ||
|
||
if [ -z "$CONTAINER_RUNTIME" ]; then | ||
echo "Neither podman nor docker is available. Please install one to proceed." | ||
exit 1 | ||
fi | ||
|
||
$CONTAINER_RUNTIME run --rm --interactive --tty --volume "$(pwd):/package" --workdir "/package" swift:5.10.1 bash -c " | ||
git config --global user.email '[email protected]' && | ||
git config --global user.name 'xcodeproj' && | ||
git config --global init.defaultBranch main && | ||
swift build --configuration release | ||
" |
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 @@ | ||
#!/usr/bin/env bash | ||
# mise description="Run tests in the host" | ||
|
||
swift test --package-path $MISE_PROJECT_ROOT |
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,16 @@ | ||
#!/usr/bin/env bash | ||
# mise description="Run tests on Linux" | ||
|
||
CONTAINER_RUNTIME=$(command -v podman || command -v docker) | ||
|
||
if [ -z "$CONTAINER_RUNTIME" ]; then | ||
echo "Neither podman nor docker is available. Please install one to proceed." | ||
exit 1 | ||
fi | ||
|
||
$CONTAINER_RUNTIME run --rm --interactive --tty --volume "$(pwd):/package" --workdir "/package" swift:5.10.1 bash -c " | ||
git config --global user.email '[email protected]' && | ||
git config --global user.name 'xcodeproj' && | ||
git config --global init.defaultBranch main && | ||
swift test | ||
" |
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 |
---|---|---|
@@ -1,52 +1,50 @@ | ||
{ | ||
"object": { | ||
"pins": [ | ||
{ | ||
"package": "AEXML", | ||
"repositoryURL": "https://github.com/tadija/AEXML.git", | ||
"state": { | ||
"branch": null, | ||
"revision": "38f7d00b23ecd891e1ee656fa6aeebd6ba04ecc3", | ||
"version": "4.6.1" | ||
} | ||
}, | ||
{ | ||
"package": "PathKit", | ||
"repositoryURL": "https://github.com/kylef/PathKit.git", | ||
"state": { | ||
"branch": null, | ||
"revision": "3bfd2737b700b9a36565a8c94f4ad2b050a5e574", | ||
"version": "1.0.1" | ||
} | ||
}, | ||
{ | ||
"package": "Spectre", | ||
"repositoryURL": "https://github.com/kylef/Spectre.git", | ||
"state": { | ||
"branch": null, | ||
"revision": "26cc5e9ae0947092c7139ef7ba612e34646086c7", | ||
"version": "0.10.1" | ||
} | ||
}, | ||
{ | ||
"package": "SwiftDocCPlugin", | ||
"repositoryURL": "https://github.com/apple/swift-docc-plugin", | ||
"state": { | ||
"branch": null, | ||
"revision": "26ac5758409154cc448d7ab82389c520fa8a8247", | ||
"version": "1.3.0" | ||
} | ||
}, | ||
{ | ||
"package": "SymbolKit", | ||
"repositoryURL": "https://github.com/apple/swift-docc-symbolkit", | ||
"state": { | ||
"branch": null, | ||
"revision": "b45d1f2ed151d057b54504d653e0da5552844e34", | ||
"version": "1.0.0" | ||
} | ||
"pins" : [ | ||
{ | ||
"identity" : "aexml", | ||
"kind" : "remoteSourceControl", | ||
"location" : "https://github.com/tadija/AEXML.git", | ||
"state" : { | ||
"revision" : "38f7d00b23ecd891e1ee656fa6aeebd6ba04ecc3", | ||
"version" : "4.6.1" | ||
} | ||
] | ||
}, | ||
"version": 1 | ||
}, | ||
{ | ||
"identity" : "pathkit", | ||
"kind" : "remoteSourceControl", | ||
"location" : "https://github.com/kylef/PathKit.git", | ||
"state" : { | ||
"revision" : "3bfd2737b700b9a36565a8c94f4ad2b050a5e574", | ||
"version" : "1.0.1" | ||
} | ||
}, | ||
{ | ||
"identity" : "spectre", | ||
"kind" : "remoteSourceControl", | ||
"location" : "https://github.com/kylef/Spectre.git", | ||
"state" : { | ||
"revision" : "26cc5e9ae0947092c7139ef7ba612e34646086c7", | ||
"version" : "0.10.1" | ||
} | ||
}, | ||
{ | ||
"identity" : "swift-docc-plugin", | ||
"kind" : "remoteSourceControl", | ||
"location" : "https://github.com/apple/swift-docc-plugin", | ||
"state" : { | ||
"revision" : "85e4bb4e1cd62cec64a4b8e769dcefdf0c5b9d64", | ||
"version" : "1.4.3" | ||
} | ||
}, | ||
{ | ||
"identity" : "swift-docc-symbolkit", | ||
"kind" : "remoteSourceControl", | ||
"location" : "https://github.com/swiftlang/swift-docc-symbolkit", | ||
"state" : { | ||
"revision" : "b45d1f2ed151d057b54504d653e0da5552844e34", | ||
"version" : "1.0.0" | ||
} | ||
} | ||
], | ||
"version" : 2 | ||
} |
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
This file was deleted.
Oops, something went wrong.