Skip to content

Commit a31e867

Browse files
committed
Split workflows into CI/nightly/release and update README badges
1 parent 4ee4746 commit a31e867

4 files changed

Lines changed: 90 additions & 44 deletions

File tree

.github/workflows/ci.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
name: CI
3+
4+
on:
5+
push:
6+
branches:
7+
- '**'
8+
pull_request:
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
test:
16+
name: Test
17+
runs-on: [self-hosted, macOS]
18+
steps:
19+
- name: Checkout Repository
20+
uses: actions/checkout@v6
21+
with:
22+
clean: true
23+
24+
- name: Clear SwiftPM Caches
25+
run: |
26+
rm -rf ~/.swiftpm
27+
rm -rf ~/Library/Caches/org.swift.swiftpm
28+
rm -rf ~/Library/org.swift.swiftpm
29+
rm -rf .swiftpm
30+
rm -rf .build
31+
32+
- name: Run Tests
33+
run: swift test -v

.github/workflows/nightly.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
name: Nightly Tests
3+
4+
on:
5+
schedule:
6+
- cron: '0 4 * * *'
7+
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.ref }}
10+
cancel-in-progress: true
11+
12+
jobs:
13+
nightly_tests:
14+
name: Nightly Tests
15+
runs-on: [self-hosted, macOS]
16+
steps:
17+
- name: Checkout Repository
18+
uses: actions/checkout@v6
19+
with:
20+
clean: true
21+
22+
- name: Clear SwiftPM Caches
23+
run: |
24+
rm -rf ~/.swiftpm
25+
rm -rf ~/Library/Caches/org.swift.swiftpm
26+
rm -rf ~/Library/org.swift.swiftpm
27+
rm -rf .swiftpm
28+
rm -rf .build
29+
30+
- name: Run Tests
31+
run: swift test -v

.github/workflows/release.yml

Lines changed: 25 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
---
2-
name: release
2+
name: Release
3+
run-name: Release ${{ github.event.release.tag_name }}
34

45
on:
5-
schedule:
6-
- cron: '0 4 * * *'
7-
push:
8-
branches:
9-
- '**'
106
release:
117
types:
128
- published
@@ -22,31 +18,15 @@ concurrency:
2218

2319
jobs:
2420
test:
25-
if: github.event_name != 'schedule'
21+
name: Test Release
2622
runs-on: [self-hosted, macOS]
2723
steps:
28-
- uses: actions/checkout@v6
24+
- name: Checkout Repository
25+
uses: actions/checkout@v6
2926
with:
3027
clean: true
31-
- name: Clear SwiftPM caches
32-
run: |
33-
rm -rf ~/.swiftpm
34-
rm -rf ~/Library/Caches/org.swift.swiftpm
35-
rm -rf ~/Library/org.swift.swiftpm
36-
rm -rf .swiftpm
37-
rm -rf .build
38-
39-
- name: Run Tests
40-
run: swift test -v
4128

42-
daily_test:
43-
if: github.event_name == 'schedule'
44-
runs-on: [self-hosted, macOS]
45-
steps:
46-
- uses: actions/checkout@v6
47-
with:
48-
clean: true
49-
- name: Clear SwiftPM caches
29+
- name: Clear SwiftPM Caches
5030
run: |
5131
rm -rf ~/.swiftpm
5232
rm -rf ~/Library/Caches/org.swift.swiftpm
@@ -57,14 +37,16 @@ jobs:
5737
- name: Run Tests
5838
run: swift test -v
5939

60-
docs:
61-
if: github.ref == 'refs/heads/main'
40+
build_docs:
41+
name: Build DocC
6242
runs-on: [self-hosted, macOS]
6343
needs: test
6444
steps:
65-
- uses: actions/checkout@v6
45+
- name: Checkout Repository
46+
uses: actions/checkout@v6
6647
with:
6748
clean: true
49+
6850
- name: Generate DocC
6951
run: |
7052
set -euo pipefail
@@ -74,31 +56,32 @@ jobs:
7456
-destination "generic/platform=iOS" \
7557
-derivedDataPath "$DERIVED_DATA"
7658
77-
DOCCARCHIVE=$(find "$DERIVED_DATA" -path "*Build/Products/*/Extensions.doccarchive" -print -quit)
78-
if [ -z "${DOCCARCHIVE:-}" ]; then
59+
DOCC_ARCHIVE=$(find "$DERIVED_DATA" -path "*Build/Products/*/Extensions.doccarchive" -print -quit)
60+
if [ -z "${DOCC_ARCHIVE:-}" ]; then
7961
echo "DocC archive not found in $DERIVED_DATA"
8062
exit 1
8163
fi
8264
8365
xcrun docc process-archive transform-for-static-hosting \
84-
"$DOCCARCHIVE" \
66+
"$DOCC_ARCHIVE" \
8567
--output-path ./public \
8668
--hosting-base-path extensions
8769
88-
cat > ./public/index.html <<'EOF'
70+
cat > ./public/index.html <<'INDEX'
8971
<!doctype html>
9072
<meta http-equiv="refresh" content="0; url=/extensions/documentation/extensions/" />
9173
<title>Extensions Documentation</title>
92-
EOF
93-
- name: Upload Pages artifact
74+
INDEX
75+
76+
- name: Upload Pages Artifact
9477
uses: actions/upload-pages-artifact@v4
9578
with:
9679
path: ./public
9780
name: github-pages
9881

99-
deploy:
100-
if: github.ref == 'refs/heads/main'
101-
needs: docs
82+
deploy_docs:
83+
name: Deploy Docs
84+
needs: build_docs
10285
runs-on: ubuntu-latest
10386
environment:
10487
name: github-pages
@@ -109,16 +92,14 @@ jobs:
10992
uses: actions/deploy-pages@v4
11093

11194
notify_package_collection:
112-
# Only notify when an actual GitHub Release is published
113-
if: github.event_name == 'release' && github.event.action == 'published'
95+
name: Notify Package Collection
11496
runs-on: ubuntu-latest
115-
needs: test
116-
97+
needs: deploy_docs
11798
steps:
118-
- name: Trigger swift-package-collection rebuild
99+
- name: Trigger Swift Package Collection Rebuild
119100
env:
120101
COLLECTION_REPO: thatfactory/swift-package-collection
121-
WORKFLOW_FILE: release.yml
102+
WORKFLOW_FILE: publish.yml
122103
REF: main
123104
GH_TOKEN: ${{ secrets.COLLECTION_TRIGGER_TOKEN }}
124105
SOURCE_REPO: ${{ github.repository }}

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
[![platforms](https://img.shields.io/badge/platforms-iOS%2018+%20%7C%20macOS%2015+%20-lightgrey.svg?logo=apple&logoColor=white)](https://en.wikipedia.org/wiki/List_of_Apple_operating_systems)
55
[![docc](https://img.shields.io/badge/docc-documentation-0288D1.svg?logo=bookstack&logoColor=white)](https://thatfactory.github.io/extensions/documentation/extensions/)
66
[![license](https://img.shields.io/badge/license-MIT-67ac5b.svg?logo=googledocs&logoColor=white)](https://en.wikipedia.org/wiki/MIT_License)
7+
[![ci](https://github.com/thatfactory/extensions/actions/workflows/ci.yml/badge.svg)](https://github.com/thatfactory/extensions/actions/workflows/ci.yml)
78
[![release](https://github.com/thatfactory/extensions/actions/workflows/release.yml/badge.svg)](https://github.com/thatfactory/extensions/actions/workflows/release.yml)
89

910
# Extensions ⚙️

0 commit comments

Comments
 (0)