mirror of
https://github.com/phranck/TUIkit.git
synced 2026-05-21 09:50:35 +00:00
ci: Merge SwiftLint and DocC workflows into single CI pipeline
Three jobs in one workflow: 1. lint — SwiftLint via Homebrew (runs on push + PR) 2. build-docs — DocC generation (runs after lint, push to main only) 3. deploy — GitHub Pages deployment (runs after build-docs) Removes the separate docc.yml and swiftlint.yml workflows.
This commit is contained in:
@@ -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
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user