mirror of
https://github.com/github/codeql.git
synced 2026-01-08 20:20:34 +01:00
The `*.bazel*` trigger currently matches * `.bazelrc` * `.bazelversion` * `WORKSPACE.bazel` * `BUILD.bazel` It will match `MODULE.bazel` as well when we add that.
40 lines
1.2 KiB
YAML
40 lines
1.2 KiB
YAML
name: "Swift: Check code generation"
|
|
|
|
on:
|
|
pull_request:
|
|
paths:
|
|
- "swift/**"
|
|
- "misc/bazel/**"
|
|
- "*.bazel*"
|
|
- .github/workflows/swift-codegen.yml
|
|
- .github/actions/fetch-codeql/action.yml
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
codegen:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- uses: ./.github/actions/fetch-codeql
|
|
- uses: bazelbuild/setup-bazelisk@v2
|
|
- uses: actions/setup-python@v3
|
|
- 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: pre-commit/action@v3.0.0
|
|
name: Check that QL generated code was checked in
|
|
with:
|
|
extra_args: swift-codegen --all-files
|
|
- name: Generate C++ files
|
|
run: |
|
|
bazel run //swift/codegen:codegen -- --generate=trap,cpp --cpp-output=$PWD/swift-generated-cpp-files
|
|
- uses: actions/upload-artifact@v3
|
|
with:
|
|
name: swift-generated-cpp-files
|
|
path: swift-generated-cpp-files/**
|