From 14b40ec77a4bf8605789cc3aff0eb87625510a41 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 29 Jul 2024 11:40:12 +0200 Subject: Adding upstream version 1.2+20240521. Signed-off-by: Daniel Baumann --- .github/CONTRIBUTING.md | 3 ++ .github/workflows/ci.yml | 65 ++++++++++++++++++++++++++++++++++++++ .github/workflows/code-quality.yml | 18 +++++++++++ 3 files changed, 86 insertions(+) create mode 100644 .github/CONTRIBUTING.md create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/code-quality.yml (limited to '.github') 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 -- cgit v1.2.3