diff --git a/.github/workflows/docc.yml b/.github/workflows/ci.yml similarity index 83% rename from .github/workflows/docc.yml rename to .github/workflows/ci.yml index e25e50c3..9c40a647 100644 --- a/.github/workflows/docc.yml +++ b/.github/workflows/ci.yml @@ -1,8 +1,10 @@ -name: Build and Deploy DocC +name: CI on: push: branches: [main] + pull_request: + branches: [main] workflow_dispatch: permissions: @@ -15,8 +17,25 @@ concurrency: cancel-in-progress: true jobs: - build: + lint: + name: SwiftLint runs-on: macos-15 + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install SwiftLint + run: brew install swiftlint + + - name: Run SwiftLint + run: swiftlint + + build-docs: + name: Build DocC + needs: lint + runs-on: macos-15 + # Only build and deploy docs on push to main (not on PRs) + if: github.event_name == 'push' || github.event_name == 'workflow_dispatch' steps: - name: Checkout uses: actions/checkout@v4 @@ -81,7 +100,8 @@ jobs: path: docs-output deploy: - needs: build + name: Deploy to GitHub Pages + needs: build-docs runs-on: ubuntu-latest environment: name: github-pages diff --git a/.github/workflows/swiftlint.yml b/.github/workflows/swiftlint.yml deleted file mode 100644 index 16aa44a2..00000000 --- a/.github/workflows/swiftlint.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: SwiftLint - -on: - push: - branches: ['main'] - pull_request: - branches: ['main'] - -jobs: - lint: - runs-on: macos-15 - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Install SwiftLint - run: brew install swiftlint - - - name: Run SwiftLint - run: swiftlint