Skip to content

Commit

Permalink
Use matrix to run debug and release
Browse files Browse the repository at this point in the history
  • Loading branch information
ahoppen committed Oct 24, 2024
1 parent 39ee6a2 commit ce212ca
Showing 1 changed file with 10 additions and 30 deletions.
40 changes: 10 additions & 30 deletions .github/workflows/publish_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,14 @@ jobs:
git format-patch "$BASE_COMMIT"..HEAD --stdout
echo EOF
} >> "$GITHUB_OUTPUT"
test_debug:
name: Test in Debug configuration
uses: swiftlang/github-workflows/.github/workflows/swift_package_test.yml@windows-pre-build
test:
name: Test in ${{ matrix.release && 'Release' || 'Debug' }} configuration
uses: swiftlang/github-workflows/.github/workflows/swift_package_test.yml@main
needs: create_release_commits
strategy:
fail-fast: false
matrix:
release: [true, false]
with:
linux_pre_build_command: |
git config --global --add safe.directory "$(realpath .)"
Expand All @@ -112,36 +116,12 @@ jobs:
# fatal: empty ident name (for <>) not allowed
cmd /c "type $env:TEMP\patch.diff | git am || (exit /b 1)"
# We require that releases of swift-format build without warnings
linux_build_command: swift test -Xswiftc -warnings-as-errors
windows_build_command: swift test -Xswiftc -warnings-as-errors
test_release:
name: Test in Release configuration
uses: swiftlang/github-workflows/.github/workflows/swift_package_test.yml@windows-pre-build
needs: create_release_commits
with:
linux_pre_build_command: |
git config --global --add safe.directory "$(realpath .)"
git config --local user.name 'swift-ci'
git config --local user.email '[email protected]'
git am << EOF
${{ needs.create_release_commits.outputs.release_commit_patch }}
EOF
windows_pre_build_command: |
git config --local user.name "swift-ci"
git config --local user.email "[email protected]"
echo @"
${{ needs.create_release_commits.outputs.release_commit_patch }}
"@ > $env:TEMP\patch.diff
# For some reason `git am` fails in Powershell with the following error. Executing it in cmd works...
# fatal: empty ident name (for <>) not allowed
cmd /c "type $env:TEMP\patch.diff | git am || (exit /b 1)"
# We require that releases of swift-format build without warnings
linux_build_command: swift test -Xswiftc -warnings-as-errors
windows_build_command: swift test -Xswiftc -warnings-as-errors
linux_build_command: swift test -Xswiftc -warnings-as-errors ${{ matrix.release && '-c release' }}
windows_build_command: swift test -Xswiftc -warnings-as-errors ${{ matrix.release && '-c release' }}
create_tag:
name: Create Tag
runs-on: ubuntu-latest
needs: [check_triggering_actor, test_debug, create_release_commits]
needs: [check_triggering_actor, test, create_release_commits]
permissions:
contents: write
steps:
Expand Down

0 comments on commit ce212ca

Please sign in to comment.