WIP: Actions: Test Swift autobuild and upload DB on failure

This commit is contained in:
Aditya Sharad
2023-03-29 16:10:42 -07:00
parent 5943513317
commit dd6901ce8f
+9 -19
View File
@@ -1,8 +1,3 @@
# Warning: This file is generated automatically, and should not be modified.
# Instead, please modify the template in the pr-checks directory and run:
# pip install ruamel.yaml && python3 sync.py
# to regenerate this file.
name: PR Check - Swift analysis using autobuild
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -11,28 +6,17 @@ env:
on:
push:
branches:
- main
- releases/v2
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
- adityasharad/swift/autobuild-test
workflow_dispatch: {}
jobs:
swift-autobuild:
strategy:
matrix:
include:
- os: macos-latest
version: latest
- os: macos-latest
version: cached
- os: macos-latest
version: nightly-latest
name: Swift analysis using autobuild
timeout-minutes: 45
timeout-minutes: 15
runs-on: ${{ matrix.os }}
steps:
- name: Check out repository
@@ -45,6 +29,7 @@ jobs:
- uses: ./../action/init
id: init
with:
debug: true
languages: swift
tools: ${{ steps.prepare-test.outputs.tools-url }}
- uses: ./../action/.github/setup-swift
@@ -65,8 +50,13 @@ jobs:
SWIFT_DB="${{ fromJson(steps.analysis.outputs.db-locations).swift }}"
if [[ ! -d "$SWIFT_DB" ]]; then
echo "Did not create a database for Swift."
exit 1
fi
- name: Upload artifact
if: failure() || cancelled()
uses: actions/upload-artifact@v3
with:
name: swift-autobuild-db
path: ${{ fromJson(steps.analysis.outputs.db-locations).swift }}
env:
CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT: 'true' # Remove when Swift is GA.
CODEQL_ACTION_TEST_MODE: true