-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore: Add a test workflow * chore: Add pip constraints * chore: Add dependabot * chore: Add workflow trigger * chore: Fix matrix yaml indentation * chore: Fix file name * chore: Add poetry cache * chore: Remove duplicate step * chore: Move poetry installation step before setup-python * chore: Use explicit Python version for Poetry venv * chore: Add lint job * chore: Use tox environments in matrix * test: Mark all tests under tests/external*/ as 'external' * test: Combine coverage * test: Continue to coverage if external tests fail * test: Add --parallel flag for coverage * Make sure tox is installed * Fix tox env name * Upload coverage * Coverage fail under 85% * Add doctest to matrix * Add dependabot for GitHub Actions * skip external tests temporarily Co-authored-by: Aaron ("AJ") Steers <aj@meltano.com>
- Loading branch information
1 parent
bdd08b6
commit 40b3b16
Showing
7 changed files
with
213 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: pip | ||
directory: "/.github/workflows" | ||
schedule: | ||
interval: daily | ||
time: "12:00" | ||
timezone: "UTC" | ||
reviewers: [meltano-engineering] | ||
labels: [deps] | ||
- package-ecosystem: github-actions | ||
directory: "/" | ||
schedule: | ||
interval: weekly | ||
reviewers: [meltano-engineering] | ||
labels: [deps] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
pip==22.1.1 | ||
poetry==1.1.13 | ||
virtualenv==20.14.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
name: Test | ||
|
||
on: | ||
pull_request: {} | ||
push: | ||
branches: [main] | ||
workflow_dispatch: | ||
inputs: {} | ||
|
||
jobs: | ||
tests: | ||
name: Test on ${{ matrix.python-version }} (${{ matrix.tox-env }}${{ matrix.external && ', external' || '' }}) / ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
continue-on-error: ${{ matrix.external || false }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- { tox-env: py, python-version: "3.7", os: "ubuntu-latest" } | ||
- { tox-env: py, python-version: "3.8", os: "ubuntu-latest" } | ||
- { tox-env: py, python-version: "3.9", os: "ubuntu-latest" } | ||
- { tox-env: py, python-version: "3.10", os: "ubuntu-latest" } | ||
#TODO: resolve by mapping CI vars to creds: | ||
# https://github.com/meltano/sdk/issues/683 | ||
# - { tox-env: py, python-version: "3.10", os: "ubuntu-latest", external: true } | ||
- { tox-env: doctest, python-version: "3.10", os: "ubuntu-latest" } | ||
- { tox-env: lint, python-version: "3.8", os: "ubuntu-latest" } | ||
|
||
steps: | ||
- name: Check out the repository | ||
uses: actions/checkout@v3.0.2 | ||
|
||
- name: Install Poetry | ||
env: | ||
PIP_CONSTRAINT: .github/workflows/constraints.txt | ||
run: | | ||
pipx install poetry | ||
poetry --version | ||
- name: Setup Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v3.1.2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
architecture: x64 | ||
cache: 'poetry' | ||
|
||
- name: Upgrade pip | ||
env: | ||
PIP_CONSTRAINT: .github/workflows/constraints.txt | ||
run: | | ||
pip install pip | ||
pip --version | ||
- name: Install Dependencies | ||
run: | | ||
poetry env use "${{ matrix.python-version }}" | ||
poetry install | ||
- name: Run tox | ||
run: | | ||
poetry run tox -e ${{ matrix.tox-env }} --${{ matrix.external && ' -m "external"' || '' }}${{ matrix.doctest && ' --doctest-modules singer_sdk' }} | ||
- name: Upload coverage data | ||
if: always() && (matrix.tox-env == 'py') | ||
uses: actions/upload-artifact@v3.1.0 | ||
with: | ||
name: coverage-data | ||
path: ".coverage.*" | ||
|
||
coverage: | ||
runs-on: ubuntu-latest | ||
needs: tests | ||
steps: | ||
- name: Check out the repository | ||
uses: actions/checkout@v3.0.2 | ||
|
||
- name: Install Poetry | ||
run: | | ||
pipx install --pip-args=--constraint=.github/workflows/constraints.txt poetry | ||
poetry --version | ||
- name: Set up Python | ||
uses: actions/setup-python@v3.1.2 | ||
with: | ||
python-version: '3.10' | ||
cache: 'poetry' | ||
|
||
- name: Upgrade pip | ||
run: | | ||
pip install --constraint=.github/workflows/constraints.txt pip | ||
pip --version | ||
- name: Download coverage data | ||
uses: actions/download-artifact@v3.0.0 | ||
with: | ||
name: coverage-data | ||
|
||
- name: Install Dependencies | ||
run: | | ||
poetry env use "3.10" | ||
poetry install | ||
- name: Combine coverage data and display human readable report | ||
run: | | ||
poetry run tox -e combine_coverage | ||
- name: Create coverage report | ||
run: | | ||
poetry run tox -e coverage_xml | ||
- name: Upload coverage report | ||
uses: codecov/codecov-action@v3.1.0 |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.