diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml deleted file mode 100644 index 7f372a52..00000000 --- a/.github/workflows/docs.yml +++ /dev/null @@ -1,65 +0,0 @@ -# Build and deploy DocC to GitHub pages. Based off of @karwa's work here: -# https://github.com/karwa/swift-url/blob/main/.github/workflows/docs.yml -# and PointFree's work here: -# https://github.com/pointfreeco/swift-composable-architecture/blob/main/.github/workflows/documentation.yml -name: Docs - -on: - release: - types: - - published - push: - branches: - - main - workflow_dispatch: - -concurrency: - group: docs-${{ github.ref }} - cancel-in-progress: true - -jobs: - build: - runs-on: macos-13 - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Checkout docs branch - uses: actions/checkout@v4 - with: - ref: gh-pages - path: docs-out - - - name: Build documentation - run: > - rm -rf docs-out/.git; - rm -rf docs-out/main; - git tag -l --sort=-v:refname | grep -e "\d\+\.\d\+.0" | tail -n +6 | xargs -I {} rm -rf {}; - - for tag in $(echo "main"; git tag -l --sort=-v:refname | grep -e "\d\+\.\d\+.0" | head -6); - do - if [ -d "docs-out/$tag/data/documentation/networking" ] - then - echo "✅ Documentation for $tag already exists."; - else - echo "⏳ Generating documentation for Networking @ $tag release."; - rm -rf "docs-out/$tag"; - - git checkout .; - git checkout "$tag"; - - make target=Networking tag="$tag" output=docs-out basepath=swift-networking documentation - fi; - done - - - name: Fix permissions - run: 'sudo chown -R $USER docs-out' - - - name: Publish documentation to GitHub Pages - uses: JamesIves/github-pages-deploy-action@v4 - with: - branch: gh-pages - folder: docs-out - single-commit: true diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 00000000..144cbc2d --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,45 @@ +name: CI/CD + +on: + push: + branches: + - main + pull_request: + branches: + - main + +concurrency: + group: ci/cd-${{ github.ref }} + cancel-in-progress: true + +jobs: + swift-package-test: + name: Test Swift Package + uses: danthorpe/ci/.github/workflows/swift-package.yml@main + secrets: inherit + with: + matrix: > + { + "include": [ + { + "os": "macos-14", + "swift": "5.9", + "xcode": "15.1" + }, + { + "os": "macos-14", + "swift": "5.10", + "xcode": "15.3" + } + ] + } + + docs: + name: Docs + if: github.event_name == 'push' + needs: [swift-package-test] + uses: danthorpe/ci/.github/workflows/docs.yml@main + with: + os: 'macos-14' + targets: '["Networking"]' + basepath: 'swift-networking' diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml deleted file mode 100644 index f4a76b7e..00000000 --- a/.github/workflows/tests.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: Tests - -on: - push: - branches: - - main - pull_request: - types: [opened, synchronize, reopened, ready_for_review] - -env: - DEVELOPER_DIR: /Applications/Xcode_15.0.app/Contents/Developer - -concurrency: - group: tests-${{ github.ref }} - cancel-in-progress: true - -jobs: - test: - runs-on: macos-13 - steps: - - name: Checkout Package - uses: actions/checkout@v4 - - - name: Cache SPM - uses: actions/cache@v4 - with: - path: .build - key: ${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }} - restore-keys: | - ${{ runner.os }}-spm- - - - name: Test - run: .scripts/ci-test.sh diff --git a/.scripts/ci-test.sh b/.scripts/ci-test.sh deleted file mode 100755 index 61579b84..00000000 --- a/.scripts/ci-test.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail - -swift test diff --git a/.scripts/format-source-code b/.scripts/format-source-code deleted file mode 100755 index d42b839c..00000000 --- a/.scripts/format-source-code +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail - -swift-format format -i -r -p --ignore-unparsable-files --configuration .swift-format Sources/ Tests/ diff --git a/Makefile b/Makefile deleted file mode 100644 index 411efb44..00000000 --- a/Makefile +++ /dev/null @@ -1,21 +0,0 @@ -CONFIG = debug -PLATFORM_IOS = iOS Simulator,id=$(call udid_for,iOS 17.2,iPhone \d\+ Pro [^M]) -PLATFORM_MACOS = macOS -PLATFORM_MAC_CATALYST = macOS,variant=Mac Catalyst -PLATFORM_TVOS = tvOS Simulator,id=$(call udid_for,tvOS 17.2,TV) -PLATFORM_VISIONOS = visionOS Simulator,id=$(call udid_for,visionOS 1.0,Vision) -PLATFORM_WATCHOS = watchOS Simulator,id=$(call udid_for,watchOS 10.2,Watch) - -default: test-all - -test-all: swift test - -documentation: - swift package \ ---allow-writing-to-directory $(output)/$(tag) \ -generate-documentation --target $(target) \ ---output-path $(output)/$(tag) \ ---transform-for-static-hosting \ ---hosting-base-path /$(basepath)/$(tag) \ -&& echo "✅ Documentation generated for $(target) @ $(tag) release." \ -|| echo "⚠️ Documentation skipped for $(target) @ $(tag)."