summaryrefslogtreecommitdiffstats
path: root/.github
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-07-29 09:40:12 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-07-29 09:40:12 +0000
commit14b40ec77a4bf8605789cc3aff0eb87625510a41 (patch)
tree4064d27144d6deaabfcd96df01bd996baa8b51a0 /.github
parentInitial commit. (diff)
downloadpython-aristaproto-upstream.tar.xz
python-aristaproto-upstream.zip
Adding upstream version 1.2+20240521.upstream/1.2+20240521upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '.github')
-rw-r--r--.github/CONTRIBUTING.md3
-rw-r--r--.github/workflows/ci.yml65
-rw-r--r--.github/workflows/code-quality.yml18
3 files changed, 86 insertions, 0 deletions
diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md
new file mode 100644
index 0000000..452f5a3
--- /dev/null
+++ b/.github/CONTRIBUTING.md
@@ -0,0 +1,3 @@
+# Contributing
+
+There's lots to do, and we're working hard, so any help is welcome!
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
new file mode 100644
index 0000000..19e1593
--- /dev/null
+++ b/.github/workflows/ci.yml
@@ -0,0 +1,65 @@
+name: CI
+
+on:
+ push:
+ branches:
+ - master
+ pull_request:
+ branches:
+ - '**'
+
+jobs:
+ tests:
+ name: ${{ matrix.os }} / ${{ matrix.python-version }}
+ runs-on: ${{ matrix.os }}-latest
+ strategy:
+ fail-fast: false
+ matrix:
+ os: [Ubuntu, MacOS, Windows]
+ python-version: ['3.9', '3.10', '3.11', '3.12']
+ steps:
+ - uses: actions/checkout@v4
+
+ - name: Set up Python ${{ matrix.python-version }}
+ uses: actions/setup-python@v5
+ with:
+ python-version: ${{ matrix.python-version }}
+
+ - name: Get full Python version
+ id: full-python-version
+ shell: bash
+ run: echo "version=$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))")" >> "$GITHUB_OUTPUT"
+
+ - name: Install poetry
+ shell: bash
+ run: |
+ python -m pip install poetry
+ echo "$HOME/.poetry/bin" >> $GITHUB_PATH
+
+ - name: Configure poetry
+ shell: bash
+ run: poetry config virtualenvs.in-project true
+
+ - name: Set up cache
+ uses: actions/cache@v3
+ id: cache
+ with:
+ path: .venv
+ key: venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }}
+
+ - name: Ensure cache is healthy
+ if: steps.cache.outputs.cache-hit == 'true'
+ shell: bash
+ run: poetry run pip --version >/dev/null 2>&1 || rm -rf .venv
+
+ - name: Install dependencies
+ shell: bash
+ run: poetry install -E compiler
+
+ - name: Generate code from proto files
+ shell: bash
+ run: poetry run python -m tests.generate -v
+
+ - name: Execute test suite
+ shell: bash
+ run: poetry run python -m pytest tests/
diff --git a/.github/workflows/code-quality.yml b/.github/workflows/code-quality.yml
new file mode 100644
index 0000000..5199807
--- /dev/null
+++ b/.github/workflows/code-quality.yml
@@ -0,0 +1,18 @@
+name: Code Quality
+
+on:
+ push:
+ branches:
+ - master
+ pull_request:
+ branches:
+ - '**'
+
+jobs:
+ check-formatting:
+ name: Check code/doc formatting
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3
+ - uses: actions/setup-python@v4
+ - uses: pre-commit/action@v2.0.3