From 0d9ecfc4decc8d678bf92057d3a08d3513210010 Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Wed, 2 Nov 2022 06:23:44 +0100 Subject: [PATCH] Swift: move small bazel tests to build action --- .github/workflows/swift.yml | 16 ++++------------ .../action.yml | 7 ++++++- swift/actions/run-ql-tests/action.yml | 6 ------ .../actions/{env-setup => setup-env}/action.yml | 0 4 files changed, 10 insertions(+), 19 deletions(-) rename swift/actions/{create-extractor-pack => create-and-test-extractor-pack}/action.yml (50%) rename swift/actions/{env-setup => setup-env}/action.yml (100%) diff --git a/.github/workflows/swift.yml b/.github/workflows/swift.yml index 4725856130d..5fff656a2ab 100644 --- a/.github/workflows/swift.yml +++ b/.github/workflows/swift.yml @@ -33,7 +33,7 @@ jobs: - 'github/workflows/swift.yml' - "misc/bazel/**" - "*.bazel*" - - 'swift/actions/env-setup/**' + - 'swift/actions/setup-env/**' - '.pre-commit-config.yaml' - 'swift/codegen/**' - 'swift/schema.py' @@ -52,17 +52,12 @@ jobs: runs-on: macos-12-xl steps: - uses: actions/checkout@v3 - - uses: ./swift/actions/create-extractor-pack - # loading bazel targets is very long on the basic macOS runner - # therefore it's better to test the X - - name: Test the Xcode autobuilder - run: | - bazel test //swift/xcode-autobuilder/tests + - uses: ./swift/actions/create-and-test-extractor-pack build-linux: runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v3 - - uses: ./swift/actions/create-extractor-pack + - uses: ./swift/actions/create-and-test-extractor-pack qltests-linux: needs: build-linux runs-on: ubuntu-latest @@ -99,14 +94,11 @@ jobs: if: ${{ needs.changes.outputs.codegen == 'true' }} steps: - uses: actions/checkout@v3 - - uses: ./swift/actions/env-setup + - uses: ./swift/actions/setup-env - uses: pre-commit/action@v3.0.0 name: Check that python code is properly formatted with: extra_args: autopep8 --all-files - - name: Run unit tests - run: | - bazel test //swift/codegen/test --test_output=errors - uses: ./.github/actions/fetch-codeql - uses: pre-commit/action@v3.0.0 name: Check that QL generated code was checked in diff --git a/swift/actions/create-extractor-pack/action.yml b/swift/actions/create-and-test-extractor-pack/action.yml similarity index 50% rename from swift/actions/create-extractor-pack/action.yml rename to swift/actions/create-and-test-extractor-pack/action.yml index d8b903816fd..f8ad7bd741e 100644 --- a/swift/actions/create-extractor-pack/action.yml +++ b/swift/actions/create-and-test-extractor-pack/action.yml @@ -3,9 +3,14 @@ description: Builds the Swift CodeQL pack runs: using: composite steps: - - uses: ./swift/actions/env-setup + - uses: ./swift/actions/setup-env - uses: ./swift/actions/share-extractor-pack - name: Build Swift extractor shell: bash run: | bazel run //swift:create-extractor-pack + # running all small tests here to avoid spinning another runner and redoing bazel analysis + - name: Run unit tests + shell: bash + run: | + bazel test --test_filter=small --build_tests_only //swift/... diff --git a/swift/actions/run-ql-tests/action.yml b/swift/actions/run-ql-tests/action.yml index b8783a95c9b..e27309a9215 100644 --- a/swift/actions/run-ql-tests/action.yml +++ b/swift/actions/run-ql-tests/action.yml @@ -8,13 +8,7 @@ inputs: runs: using: composite steps: - - uses: ./swift/actions/env-setup - uses: ./swift/actions/share-extractor-pack - - uses: ./swift/actions/share-extractor-pack - - name: Test qltest.sh - shell: bash - run: | - bazel test //swift/tools/test/qltest - uses: ./.github/actions/fetch-codeql - name: Run QL tests shell: bash diff --git a/swift/actions/env-setup/action.yml b/swift/actions/setup-env/action.yml similarity index 100% rename from swift/actions/env-setup/action.yml rename to swift/actions/setup-env/action.yml