PureYAML/.github/workflows/ci.yml

64 lines
1.9 KiB
YAML

name: CI
# PureYAML is a root Swift package. CI must prove macOS, Linux, and WASM.
on:
push:
branches: [main]
pull_request:
permissions:
contents: read
jobs:
macos:
name: macOS
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Install format and lint tools
run: brew install swiftformat swiftlint
- name: Repository gates
run: |
bash scripts/check-style.sh
bash scripts/check-namespacing.sh
git fetch origin main --depth=1 || true
BASE_REF=origin/main bash scripts/check-changelog-touched.sh
- name: Format and lint
run: |
swiftformat . --config .swiftformat --lint
swiftlint --config .swiftlint.yml --strict
- name: Build and test
run: |
swift build
swift test
linux:
name: Linux
runs-on: ubuntu-latest
container: swift:6.2
steps:
- uses: actions/checkout@v4
- name: Build and test
run: bash scripts/check-linux.sh
wasm:
name: WASM
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install swiftly
run: |
curl -L https://download.swift.org/swiftly/linux/swiftly-$(uname -m).tar.gz > swiftly.tar.gz
tar zxf swiftly.tar.gz
./swiftly init --quiet-shell-followup --assume-yes --skip-install
- name: Install Swift 6.3.2 and Wasm SDK
run: |
. "${SWIFTLY_HOME_DIR:-$HOME/.local/share/swiftly}/env.sh"
swiftly install --use 6.3.2
swift sdk install https://download.swift.org/swift-6.3.2-release/wasm-sdk/swift-6.3.2-RELEASE/swift-6.3.2-RELEASE_wasm.artifactbundle.tar.gz --checksum a61f0584c93283589f8b2f42db05c1f9a182b506c2957271402992655591dd7c
- name: Build for WASM
run: |
. "${SWIFTLY_HOME_DIR:-$HOME/.local/share/swiftly}/env.sh"
bash scripts/check-wasm.sh