Skip to content

Commit bff77ee

Browse files
committed
Add tests to CI
1 parent c6a0223 commit bff77ee

File tree

4 files changed

+47
-4
lines changed

4 files changed

+47
-4
lines changed

.github/workflows/ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: ginac-lean-workflow
22

33
on:
4-
# Triggers the workflow on push or pull request events but only for the "master" branch
4+
# Triggers the workflow on push or pull request events but only for the "main" branch
55
push:
66
branches: [ "main" ]
77
pull_request:

.github/workflows/codegen.yml

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: ginac-lean-codegen
2+
3+
on:
4+
# Triggers the workflow on push or pull request events but only for the "main" branch
5+
push:
6+
branches: [ "main" ]
7+
pull_request:
8+
branches: [ "main" ]
9+
10+
# Allows you to run this workflow manually from the Actions tab
11+
workflow_dispatch:
12+
13+
jobs:
14+
codegen:
15+
name: ginac-lean-codegen
16+
runs-on: ${{ matrix.os }}
17+
strategy:
18+
matrix:
19+
os: [ubuntu-latest] # , macos-latest] # , windows-latest]
20+
fail-fast: false
21+
steps:
22+
- uses: actions/checkout@v3
23+
- name: Setup Python
24+
uses: actions/[email protected]
25+
with:
26+
python-version: 3.11
27+
- name: package install
28+
run: |
29+
pip install -r codegen/requirements.txt -r codegen/requirements-dev.txt -r codegen/requirements-tests.txt
30+
- name: run pre-commit
31+
run: |
32+
pre-commit run --all-files
33+
- name: run codegen tests
34+
run: |
35+
pytest codegen/tests

.pre-commit-config.yaml

+10-3
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,17 @@ repos:
77
hooks:
88
- id: check-yaml
99
- id: end-of-file-fixer
10-
exclude: ^scripts/.*patch$
10+
exclude: |
11+
(?x)^(
12+
scripts/.*patch |
13+
codegen/templates/.*
14+
)$
1115
- id: trailing-whitespace
12-
exclude: ^scripts/.*patch$
13-
16+
exclude: |
17+
(?x)^(
18+
scripts/.*patch |
19+
codegen/templates/.*
20+
)$
1421
- repo: https://github.com/psf/black
1522
rev: 23.3.0
1623
hooks:

codegen/templates/lean/base.lean.j2

+1
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ namespace {{namespace}}
77
{% block content %}{% endblock %}
88

99
end {{namespace}}
10+

0 commit comments

Comments
 (0)