Files
codeql/.github/workflows/swift-codegen.yml
Paolo Tranquilli f171ce6341 Swift: add unit tests to code generation
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
```
2022-04-27 08:24:11 +02:00

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