Skip to content

Create top-level CI workflow with proper template workflow delegation #6

Create top-level CI workflow with proper template workflow delegation

Create top-level CI workflow with proper template workflow delegation #6

Workflow file for this run

name: "Swift 6 Module Template CI"
on:
push:
branches:
- main
pull_request:
branches:
- main
concurrency:
group: ${{ github.ref_name }}
cancel-in-progress: true
jobs:
test-configure-script:
name: Test configure.swift script and generate project
runs-on: macos-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- name: Test configure script with environment variables
env:
SMT_XXPROJECTXNAMEXX: "TestModule"
SMT_ORGANIZATION_NAME: "Test Organization"
SMT_COM_AN_ORGANIZATION_IDENTIFIER: "com.test.organization"
SMT_AUTHOR_NAME: "Test Author"
SMT_TODAYS_DATE: "January 1, 2024"
SMT_TODAYS_YEAR: "2024"
SMT_GITHUB_USERNAME: "testuser"
run: |
./configure.swift
ls -la OUTPUT/
- name: Verify generated project structure
run: |
cd OUTPUT/TestModule
ls -la
test -f Package.swift
test -f README.md
test -f LICENSE
test -d Sources/TestModule
test -d Tests/TestModuleTests
test -d .github/workflows
- name: Upload generated project as artifact
uses: actions/upload-artifact@v4
with:
name: generated-project
path: OUTPUT/TestModule/
test-generated-project:
name: Test generated project using template workflow
needs: test-configure-script
runs-on: macos-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- name: Download generated project
uses: actions/download-artifact@v4
with:
name: generated-project
path: TestModule/
- uses: swift-actions/setup-swift@v2
with:
swift-version: "6.1.0"
- name: Test generated Swift package
run: |
cd TestModule
swift build
swift test
- name: Test generated Example project
run: |
cd TestModule/Example
xcodebuild -project Example.xcodeproj -scheme Example -destination "platform=iOS Simulator,name=iPhone 15" clean build
# delegate-to-template-workflow:
# Don't know how to do this