Feature: CI, formats, tests, release scripts #5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build - macOS | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
build-and-test: | |
name: Build and Test on macOS | |
runs-on: macos-latest | |
strategy: | |
matrix: | |
swift: ['6.0'] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup Swift | |
uses: swift-actions/[email protected] | |
with: | |
swift-version: ${{ matrix.swift }} | |
- name: Show Swift version | |
run: swift --version | |
- name: Cache Swift packages | |
uses: actions/cache@v4 | |
with: | |
path: .build | |
key: ${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }} | |
restore-keys: | | |
${{ runner.os }}-spm- | |
- name: Build Debug | |
run: ./build-debug.sh | |
- name: Build Release | |
run: ./build-release.sh | |
- name: Run Tests | |
run: ./run-swift-test.sh | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
if: matrix.swift == '6.0' | |
with: | |
name: swiftlings-macos | |
path: .build/release/swiftlings |