From dd6901ce8f72e115cdf40c285170e16119436de1 Mon Sep 17 00:00:00 2001 From: Aditya Sharad Date: Wed, 29 Mar 2023 16:10:42 -0700 Subject: [PATCH] WIP: Actions: Test Swift autobuild and upload DB on failure --- .github/workflows/__swift-autobuild.yml | 28 ++++++++----------------- 1 file changed, 9 insertions(+), 19 deletions(-) diff --git a/.github/workflows/__swift-autobuild.yml b/.github/workflows/__swift-autobuild.yml index 829a82975..178c6b967 100644 --- a/.github/workflows/__swift-autobuild.yml +++ b/.github/workflows/__swift-autobuild.yml @@ -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