Skip to content
This repository was archived by the owner on Jun 9, 2025. It is now read-only.

Commit 94af6a3

Browse files
committed
Add compilation workflow
1 parent b31f4e7 commit 94af6a3

File tree

1 file changed

+69
-0
lines changed

1 file changed

+69
-0
lines changed

.github/workflows/compilation.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: compilation
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request: # TODEL
8+
branches:
9+
- '**'
10+
11+
permissions:
12+
contents: write
13+
14+
jobs:
15+
deploy:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Configure Git Credentials
21+
run: |
22+
git config user.name github-actions[bot]
23+
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
24+
25+
- name: Set up Python 3.12
26+
uses: actions/setup-python@v5
27+
with:
28+
python-version: 3.12
29+
30+
- name: Install poetry
31+
shell: bash
32+
run: |
33+
python -m pip install poetry
34+
echo "$HOME/.poetry/bin" >> $GITHUB_PATH
35+
36+
- name: Configure poetry
37+
shell: bash
38+
run: poetry config virtualenvs.in-project true
39+
40+
- name: Set up cache
41+
uses: actions/cache@v3
42+
id: cache
43+
with:
44+
path: .venv
45+
key: venv-compilation-${{ hashFiles('**/poetry.lock') }}
46+
47+
- name: Ensure cache is healthy
48+
if: steps.cache.outputs.cache-hit == 'true'
49+
shell: bash
50+
run: poetry run pip --version >/dev/null 2>&1 || rm -rf .venv
51+
52+
- name: Install dependencies
53+
shell: bash
54+
run: poetry install
55+
56+
- name: Compile proto files
57+
shell: bash
58+
run: poetry run poe generate
59+
60+
- name: Publish the compiled files
61+
shell: bash
62+
run: |
63+
git checkout --orphan compiled-test-files
64+
cp tests/output_betterproto tests_betterproto
65+
cp tests/output_betterproto_pydantic tests_betterproto_pydantic
66+
cp tests/output_reference tests_reference
67+
git add tests_betterproto tests_betterproto_pydantic tests_reference
68+
git commit -m "Add compilation output"
69+
git push --force origin compiled-test-files

0 commit comments

Comments
 (0)