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

Commit 08878ac

Browse files
Remove lib, keep only compiler (#1)
* Remove non-compiler files * Remove non-compiler files * Rename files, mark compilation working again * Update Python version * Remove lib files * Update CI * Fix Python version * Add compilation workflow * Fix cp command * Execute only on push to main * Reset git before adding generated files * Don't compile on PRs * Update doc config
1 parent 048867c commit 08878ac

File tree

98 files changed

+726
-6822
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+726
-6822
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
fail-fast: false
1717
matrix:
1818
os: [Ubuntu, MacOS, Windows]
19-
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
19+
python-version: ['3.10', '3.11', '3.12']
2020
steps:
2121
- uses: actions/checkout@v4
2222

@@ -54,12 +54,8 @@ jobs:
5454

5555
- name: Install dependencies
5656
shell: bash
57-
run: poetry install -E compiler
57+
run: poetry install
5858

5959
- name: Generate code from proto files
6060
shell: bash
6161
run: poetry run python -m tests.generate -v
62-
63-
- name: Execute test suite
64-
shell: bash
65-
run: poetry run python -m pytest tests/

.github/workflows/compilation.yml

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

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ jobs:
1616
runs-on: ubuntu-latest
1717
steps:
1818
- uses: actions/checkout@v3
19-
- name: Set up Python 3.8
19+
- name: Set up Python 3.10
2020
uses: actions/setup-python@v4
2121
with:
22-
python-version: 3.8
22+
python-version: "3.10"
2323
- name: Install poetry
2424
run: python -m pip install poetry
2525
- name: Build package

0 commit comments

Comments
 (0)