Repository navigation
docs: document the project across six focused files plus AGENTS.md (#12) #14
This file contains hidden or 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
| name: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| format: | |
| name: Format | |
| runs-on: macos-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Show toolchain | |
| run: swift --version | |
| # swift-format ships inside the Xcode toolchain, so this runs on every runner | |
| # regardless of which Swift version it carries. `lint` exits non-zero on warnings; | |
| # `--strict` promotes the softer diagnostics too. | |
| - name: Lint | |
| run: | | |
| xcrun swift-format lint --recursive --strict --configuration .swift-format Sources Tests | |
| # Reformat in place, then fail if git sees a change: that means the committed | |
| # formatting is not what the formatter produces. | |
| - name: Check formatting is applied | |
| run: | | |
| xcrun swift-format format --in-place --recursive --configuration .swift-format Sources Tests | |
| if ! git diff --quiet; then | |
| echo "::error::Formatting differs. Run:" | |
| echo "::error::swift-format format --in-place --recursive --configuration .swift-format Sources Tests" | |
| git --no-pager diff --stat | |
| exit 1 | |
| fi | |
| syntax: | |
| name: Syntax | |
| runs-on: macos-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Show toolchain | |
| run: swift --version | |
| # Type-checking needs the full dependency graph, which needs SwiftPM 6.4 for | |
| # CodeEditSourceEditor 0.15's resource bundles. Parsing does not, so this is | |
| # the strongest check available on a hosted runner today. See README. | |
| - name: Parse every source file | |
| run: | | |
| rc=0 | |
| while read -r file; do | |
| if ! output=$(swiftc -parse "$file" 2>&1); then | |
| echo "::error file=${file}::$(echo "$output" | head -1)" | |
| rc=1 | |
| fi | |
| done < <(find Sources Tests -name '*.swift') | |
| exit $rc | |
| # Build and test run locally and in release, not here: the package declares | |
| # swift-tools-version 6.4 and CodeEditSourceEditor 0.15 needs SwiftPM 6.4 to | |
| # generate its resource bundles, while hosted runners top out at 6.3.3. Lowering the | |
| # manifest to 6.3 fails inside a dependency (CodeEditSymbols 0.2.3 has no resources | |
| # declared, so SwiftPM 6.3 does not emit Bundle.module). Add a `build` job here when | |
| # a runner ships 6.4. |