Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try adding CI for MUSL #199

Merged
merged 18 commits into from
Jun 14, 2024
29 changes: 26 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,41 @@ on:
pull_request: { types: [opened, reopened, synchronize, ready_for_review] }
push: { branches: [ main ] }

jobs:
jobs:
unit-tests:
uses: vapor/ci/.github/workflows/run-unit-tests.yml@main
secrets: inherit

integration-check:
runs-on: ubuntu-latest
container: swift:jammy
container: swift:noble
steps:
- uses: actions/checkout@v4
with: { path: console-kit }
- uses: actions/checkout@v4
with: { repository: 'vapor/vapor', path: vapor }
- run: swift package --package-path vapor edit console-kit --path console-kit
- run: swift test --package-path vapor
- run: SWIFT_DETERMINISTIC_HASHING=1 swift test --package-path vapor

musl-unit:
runs-on: ubuntu-latest
container: archlinux:latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Install latest Swift from AUR
run: |
# https://www.reddit.com/r/archlinux/comments/6qu4jt/comment/dl1t5m9/
pacman -Sy --needed --noconfirm sudo git base-devel patchelf
useradd builduser -m && passwd -d builduser && echo 'builduser ALL=(ALL) ALL' >> /etc/sudoers
sudo -u builduser bash -c \
'cd ~ && git clone https://aur.archlinux.org/swift-bin.git && cd swift-bin && sed -i~ "s/swiftc;/swiftc llvm-cov;/" PKGBUILD && makepkg -si --noconfirm swift-bin'
- name: Run unit tests
run: |
SWIFT_DETERMINISTIC_HASHING=1 \
swift test \
--enable-code-coverage
- name: Upload coverage data
uses: vapor/swift-codecov-action@v0.3
with:
codecov_token: ${{ secrets.CODECOV_TOKEN || '' }}