mirror of
https://github.com/github/codeql.git
synced 2025-12-16 08:43:11 +01:00
Tests can be run with ``` bazel test //swift/codegen:tests ``` Coverage can be checked installing `pytest-cov` and running ``` pytest --cov=swift/codegen swift/codegen/test ```
33 lines
821 B
YAML
33 lines
821 B
YAML
name: "Swift: Check code generation"
|
|
|
|
on:
|
|
pull_request:
|
|
paths:
|
|
- "swift/**"
|
|
- .github/workflows/swift-codegen.yml
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
codegen:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: actions/setup-python@v3
|
|
with:
|
|
python-version: '~3.7'
|
|
cache: 'pip'
|
|
- uses: ./.github/actions/fetch-codeql
|
|
- uses: bazelbuild/setup-bazelisk@v2
|
|
- name: Install dependencies
|
|
run: |
|
|
pip install -r swift/codegen/requirements.txt
|
|
- name: Run unit tests
|
|
run: |
|
|
bazel test //swift/codegen:tests --test_output=errors
|
|
- name: Check that code was generated
|
|
run: |
|
|
bazel run //swift/codegen
|
|
git add swift
|
|
git diff --exit-code --stat HEAD
|