From ea31bb586411ae06de96d359234d14ad5f13b394 Mon Sep 17 00:00:00 2001 From: Mihaela M Date: Fri, 26 Jun 2026 05:48:11 +0200 Subject: [PATCH] chore(ci): split CI into per-workflow files with truthful badges Rule 8.1 forbids one multi-job workflow fronted by several cosmetically labeled badges that all resolve to the same whole-workflow status. Split ci.yml into one workflow per concern (gates, macOS, Linux, Windows, WASM, corpus), each with a unique name, and point each README badge at its own workflow through the native per-workflow badge. The WASM workflow notes in a header that it is a build gate, not a test gate (Rule 8.3). Add a static MIT license badge linking to LICENSE (Rule 8.2). Step contents are unchanged from the previous jobs. --- .github/workflows/ci.yml | 114 ---------------------------------- .github/workflows/corpus.yml | 35 +++++++++++ .github/workflows/gates.yml | 35 +++++++++++ .github/workflows/linux.yml | 22 +++++++ .github/workflows/macos.yml | 25 ++++++++ .github/workflows/wasm.yml | 38 ++++++++++++ .github/workflows/windows.yml | 28 +++++++++ README.md | 10 +-- 8 files changed, 189 insertions(+), 118 deletions(-) delete mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/corpus.yml create mode 100644 .github/workflows/gates.yml create mode 100644 .github/workflows/linux.yml create mode 100644 .github/workflows/macos.yml create mode 100644 .github/workflows/wasm.yml create mode 100644 .github/workflows/windows.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index 5896c4c..0000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,114 +0,0 @@ -name: CI - -# PureYAML is a root Swift package. CI must prove macOS, Linux, Windows, and WASM. - -on: - push: - branches: [main] - pull_request: - workflow_dispatch: - schedule: - - cron: "0 6 * * 1" - -permissions: - contents: read - issues: read - -jobs: - macos: - name: macOS - runs-on: macos-latest - steps: - - uses: actions/checkout@v6 - - name: Install format and lint tools - run: brew install swiftformat swiftlint - - name: Repository gates - env: - GH_TOKEN: ${{ github.token }} - run: | - bash scripts/check-style.sh - bash scripts/check-namespacing.sh - bash scripts/check-forbidden-patterns.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 - swift build -c release - swift test -c release - - linux: - name: Linux - runs-on: ubuntu-latest - container: swift:6.2 - steps: - - uses: actions/checkout@v6 - - name: Build and test - run: bash scripts/check-linux.sh - - windows: - name: Windows - runs-on: windows-2022 - timeout-minutes: 45 - steps: - - uses: actions/checkout@v6 - - name: Install Swift - uses: compnerd/gha-setup-swift@main - with: - swift-version: swift-6.3.2-release - swift-build: 6.3.2-RELEASE - - name: Build and test - shell: pwsh - run: ./scripts/check-windows.ps1 - - wasm: - name: WASM - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v6 - - name: Install Swift toolchain dependencies - run: | - sudo apt-get update - sudo apt-get install -y libcurl4-openssl-dev - - 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 - - corpus: - name: Corpus - if: github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' - runs-on: macos-latest - steps: - - uses: actions/checkout@v6 - - name: Run corpus gates - run: | - bash scripts/check-json-compatibility.sh - bash scripts/check-corpus.sh - bash scripts/check-yams-differential.sh - bash scripts/check-yams-diagnostics.sh - bash scripts/check-yams-validation.sh - bash scripts/check-throughput.sh - bash scripts/check-performance-phases.sh - - name: Upload corpus artifacts - if: always() - uses: actions/upload-artifact@v6 - with: - name: pureyaml-corpus-${{ runner.os }}-${{ github.sha }} - path: .build/pureyaml-artifacts - retention-days: 30 diff --git a/.github/workflows/corpus.yml b/.github/workflows/corpus.yml new file mode 100644 index 0000000..407be93 --- /dev/null +++ b/.github/workflows/corpus.yml @@ -0,0 +1,35 @@ +name: Corpus + +# Heavy corpus, differential, and throughput gates. Scheduled and manual only; +# not a platform claim, so it carries no README badge. + +on: + workflow_dispatch: + schedule: + - cron: "0 6 * * 1" + +permissions: + contents: read + +jobs: + corpus: + name: Corpus + runs-on: macos-latest + steps: + - uses: actions/checkout@v6 + - name: Run corpus gates + run: | + bash scripts/check-json-compatibility.sh + bash scripts/check-corpus.sh + bash scripts/check-yams-differential.sh + bash scripts/check-yams-diagnostics.sh + bash scripts/check-yams-validation.sh + bash scripts/check-throughput.sh + bash scripts/check-performance-phases.sh + - name: Upload corpus artifacts + if: always() + uses: actions/upload-artifact@v6 + with: + name: pureyaml-corpus-${{ runner.os }}-${{ github.sha }} + path: .build/pureyaml-artifacts + retention-days: 30 diff --git a/.github/workflows/gates.yml b/.github/workflows/gates.yml new file mode 100644 index 0000000..0bec328 --- /dev/null +++ b/.github/workflows/gates.yml @@ -0,0 +1,35 @@ +name: Gates + +# Repository style/structure gates plus format and lint. One concern, one badge. + +on: + push: + branches: [main] + pull_request: + workflow_dispatch: + +permissions: + contents: read + issues: read + +jobs: + gates: + name: Gates + runs-on: macos-latest + steps: + - uses: actions/checkout@v6 + - name: Install format and lint tools + run: brew install swiftformat swiftlint + - name: Repository gates + env: + GH_TOKEN: ${{ github.token }} + run: | + bash scripts/check-style.sh + bash scripts/check-namespacing.sh + bash scripts/check-forbidden-patterns.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 diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml new file mode 100644 index 0000000..6bf83ab --- /dev/null +++ b/.github/workflows/linux.yml @@ -0,0 +1,22 @@ +name: Linux + +# Linux build and test in the official Swift container. One concern, one badge. + +on: + push: + branches: [main] + pull_request: + workflow_dispatch: + +permissions: + contents: read + +jobs: + linux: + name: Linux + runs-on: ubuntu-latest + container: swift:6.2 + steps: + - uses: actions/checkout@v6 + - name: Build and test + run: bash scripts/check-linux.sh diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml new file mode 100644 index 0000000..ccb0cce --- /dev/null +++ b/.github/workflows/macos.yml @@ -0,0 +1,25 @@ +name: macOS + +# macOS build and test (debug and release). One concern, one badge. + +on: + push: + branches: [main] + pull_request: + workflow_dispatch: + +permissions: + contents: read + +jobs: + macos: + name: macOS + runs-on: macos-latest + steps: + - uses: actions/checkout@v6 + - name: Build and test + run: | + swift build + swift test + swift build -c release + swift test -c release diff --git a/.github/workflows/wasm.yml b/.github/workflows/wasm.yml new file mode 100644 index 0000000..70af862 --- /dev/null +++ b/.github/workflows/wasm.yml @@ -0,0 +1,38 @@ +name: WASM + +# WASM build gate (Rule 8.3): the WASI SDK compiles the package; it does not run +# the test suite. A green badge here means "compiles for WASM", not "tests pass". + +on: + push: + branches: [main] + pull_request: + workflow_dispatch: + +permissions: + contents: read + +jobs: + wasm: + name: WASM + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + - name: Install Swift toolchain dependencies + run: | + sudo apt-get update + sudo apt-get install -y libcurl4-openssl-dev + - 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 diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml new file mode 100644 index 0000000..cef62e2 --- /dev/null +++ b/.github/workflows/windows.yml @@ -0,0 +1,28 @@ +name: Windows + +# Windows build and test on the Swift 6.3.2 toolchain. One concern, one badge. + +on: + push: + branches: [main] + pull_request: + workflow_dispatch: + +permissions: + contents: read + +jobs: + windows: + name: Windows + runs-on: windows-2022 + timeout-minutes: 45 + steps: + - uses: actions/checkout@v6 + - name: Install Swift + uses: compnerd/gha-setup-swift@main + with: + swift-version: swift-6.3.2-release + swift-build: 6.3.2-RELEASE + - name: Build and test + shell: pwsh + run: ./scripts/check-windows.ps1 diff --git a/README.md b/README.md index 45a1020..0a58169 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,11 @@ # PureYAML -[![macOS CI](https://img.shields.io/github/actions/workflow/status/mihaelamj/PureYAML/ci.yml?branch=main&label=macOS)](https://github.com/mihaelamj/PureYAML/actions/workflows/ci.yml) -[![Linux CI](https://img.shields.io/github/actions/workflow/status/mihaelamj/PureYAML/ci.yml?branch=main&label=Linux)](https://github.com/mihaelamj/PureYAML/actions/workflows/ci.yml) -[![Windows CI](https://img.shields.io/github/actions/workflow/status/mihaelamj/PureYAML/ci.yml?branch=main&label=Windows)](https://github.com/mihaelamj/PureYAML/actions/workflows/ci.yml) -[![WASI CI](https://img.shields.io/github/actions/workflow/status/mihaelamj/PureYAML/ci.yml?branch=main&label=WASI)](https://github.com/mihaelamj/PureYAML/actions/workflows/ci.yml) +[![Gates](https://github.com/mihaelamj/PureYAML/actions/workflows/gates.yml/badge.svg?branch=main)](https://github.com/mihaelamj/PureYAML/actions/workflows/gates.yml) +[![macOS](https://github.com/mihaelamj/PureYAML/actions/workflows/macos.yml/badge.svg?branch=main)](https://github.com/mihaelamj/PureYAML/actions/workflows/macos.yml) +[![Linux](https://github.com/mihaelamj/PureYAML/actions/workflows/linux.yml/badge.svg?branch=main)](https://github.com/mihaelamj/PureYAML/actions/workflows/linux.yml) +[![Windows](https://github.com/mihaelamj/PureYAML/actions/workflows/windows.yml/badge.svg?branch=main)](https://github.com/mihaelamj/PureYAML/actions/workflows/windows.yml) +[![WASM](https://github.com/mihaelamj/PureYAML/actions/workflows/wasm.yml/badge.svg?branch=main)](https://github.com/mihaelamj/PureYAML/actions/workflows/wasm.yml) +[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE) PureYAML is a dependency-free YAML package written entirely in Swift.