Skip to content

Fix session usage for OctoKit.swift update #188

Fix session usage for OctoKit.swift update

Fix session usage for OctoKit.swift update #188

Workflow file for this run

name: Test
on:
pull_request:
paths:
- '**.swift'
- 'Package.resolved'
- '.github/workflows/test.yml'
- '.github/versions.json'
concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true
jobs:
generate-matrix:
name: Generate matrix
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- id: set-matrix
run: |
matrix=$(cat .github/versions.json | jq -rc .)
echo "matrix=$matrix" >> $GITHUB_OUTPUT
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
macOS:
name: macOS
needs: generate-matrix
runs-on: macOS-12
env:
DEVELOPER_DIR: /Applications/Xcode_${{ fromJson(needs.generate-matrix.outputs.matrix).xcode_version }}.app/Contents/Developer
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: .build
key: ${{ runner.os }}-swift-${{ hashFiles('Package.resolved') }}
restore-keys: |
${{ runner.os }}-swift
${{ runner.os }}-
- name: test
run: |
swift package clean
set -o pipefail && xcrun --sdk macosx \
xcodebuild \
"OTHER_LDFLAGS=\$(OTHER_LDFLAGS) -Wl -weak-lswift_Concurrency -Wl -rpath /usr/lib/swift" \
-enableCodeCoverage YES \
-scheme "$(xcrun --sdk macosx xcodebuild -list -json | jq -r '.workspace.schemes[0]' 2>/dev/null)" \
-destination "platform=macOS" \
-clonedSourcePackagesDirPath '.build' \
-resultBundlePath 'test_output/SSGH.xcresult' \
clean test | xcpretty
- uses: kishikawakatsumi/xcresulttool@v1
if: success() || failure()
with:
path: test_output/SSGH.xcresult
show-passed-tests: false
show-code-coverage: false
linux:
name: Linux
needs: generate-matrix
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
swift_version: ${{ fromJson(needs.generate-matrix.outputs.matrix).swift_version }}
container:
image: swift:${{ matrix.swift_version }}
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: .build
key: ${{ runner.os }}-swift-${{ matrix.swift_version }}-${{ hashFiles('Package.resolved') }}
restore-keys: |
${{ runner.os }}-swift-${{ matrix.swift_version }}
${{ runner.os }}-swift
${{ runner.os }}-
- name: build
run: swift build
- name: test
run: swift package clean && swift test