Skip to content

CI

CI #127

Workflow file for this run

name: CI
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
schedule:
# Run nightly at 2 AM UTC (adjust timezone as needed)
- cron: '0 2 * * *'
jobs:
build-and-test:
name: Build and Test
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-14]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Xcode 16.0
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '16'
- name: Show Xcode version
run: xcodebuild -version
- name: Show Swift version
run: swift --version
# Note: Logging is disabled by default (LogLevel.off) for security
# This ensures no sensitive data is logged in CI environments
- name: Cache Swift packages
uses: actions/cache@v4
with:
path: .build
key: ${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}
restore-keys: |
${{ runner.os }}-spm-
- name: Cache DerivedData
uses: actions/cache@v4
with:
path: ~/Library/Developer/Xcode/DerivedData
key: ${{ runner.os }}-deriveddata-${{ hashFiles('**/*.swift') }}
restore-keys: |
${{ runner.os }}-deriveddata-
- name: Resolve package dependencies
run: swift package resolve
- name: Build package
run: swift build -v
- name: Run tests
run: swift test -v --enable-code-coverage
- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: test-results-${{ matrix.os }}
path: |
.build/test-results/
.build/coverage/
retention-days: 30
- name: Build SampleApp Xcode project (if possible)
run: |
cd Examples/SampleApp
xcodebuild -project SampleApp.xcodeproj -scheme SampleApp -destination 'platform=iOS Simulator,name=iPhone 15' build || echo "SampleApp Xcode build failed (expected in CI without simulator)"
- name: Check for build warnings
run: |
echo "Checking for build warnings..."
swift build 2>&1 | grep -i warning || echo "No warnings found"
- name: Verify package structure
run: |
echo "Verifying package structure..."
ls -la Sources/AsgardeoAuth/
ls -la Tests/AsgardeoAuthTests/
echo "Package structure verified ✅"
lint:
name: Lint Code
runs-on: macos-14
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Xcode 16.0
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '16'
- name: Install SwiftLint
run: brew install swiftlint
- name: Run SwiftLint
run: swiftlint lint --reporter github-actions-logging
continue-on-error: true
- name: Upload lint results
uses: actions/upload-artifact@v4
if: always()
with:
name: lint-results
path: |
.swiftlint-results/
retention-days: 7# Updated Thu Oct 9 20:20:23 IST 2025