mirror of
https://github.com/github/codeql.git
synced 2026-05-04 13:15:21 +02:00
Also fixes python version with a `.pythonversion` file. Bumps [actions/setup-python](https://github.com/actions/setup-python) from 3 to 4. - [Release notes](https://github.com/actions/setup-python/releases) - [Commits](https://github.com/actions/setup-python/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/setup-python dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
45 lines
1.3 KiB
YAML
45 lines
1.3 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
|
|
defaults:
|
|
run:
|
|
working-directory: swift
|
|
|
|
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@v4
|
|
with:
|
|
python-version-file: 'swift/.python-version'
|
|
- 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/**
|