Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Add a test workflow #679

Merged
merged 23 commits into from Jun 1, 2022
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
244bb99
chore: Add a test workflow
edgarrmondragon May 30, 2022
8a82a52
chore: Add pip constraints
edgarrmondragon May 30, 2022
0dd412f
chore: Add dependabot
edgarrmondragon May 30, 2022
bce055b
chore: Add workflow trigger
edgarrmondragon May 30, 2022
5bdd314
chore: Fix matrix yaml indentation
edgarrmondragon May 30, 2022
d60a990
chore: Fix file name
edgarrmondragon May 30, 2022
8acd214
chore: Add poetry cache
edgarrmondragon May 30, 2022
51eacaf
chore: Remove duplicate step
edgarrmondragon May 30, 2022
8e8c2c6
chore: Move poetry installation step before setup-python
edgarrmondragon May 30, 2022
9e41c41
chore: Use explicit Python version for Poetry venv
edgarrmondragon May 30, 2022
d0475bf
chore: Add lint job
edgarrmondragon May 30, 2022
82b08e2
chore: Use tox environments in matrix
edgarrmondragon May 31, 2022
3596977
test: Mark all tests under tests/external*/ as 'external'
edgarrmondragon May 31, 2022
999e10b
test: Combine coverage
edgarrmondragon May 31, 2022
85ae491
test: Continue to coverage if external tests fail
edgarrmondragon May 31, 2022
ef6b2bc
test: Add --parallel flag for coverage
edgarrmondragon May 31, 2022
751fd9e
Make sure tox is installed
edgarrmondragon May 31, 2022
be8c8bc
Fix tox env name
edgarrmondragon May 31, 2022
f9b661f
Upload coverage
edgarrmondragon May 31, 2022
784a631
Coverage fail under 85%
edgarrmondragon May 31, 2022
c846247
Add doctest to matrix
edgarrmondragon May 31, 2022
ff7e13f
Add dependabot for GitHub Actions
edgarrmondragon May 31, 2022
d44eb3c
skip external tests temporarily
aaronsteers Jun 1, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/dependabot.yml
@@ -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]
3 changes: 3 additions & 0 deletions .github/workflows/constraints.txt
@@ -0,0 +1,3 @@
pip==22.1.1
poetry==1.1.13
virtualenv==20.14.1
110 changes: 110 additions & 0 deletions .github/workflows/test.yml
@@ -0,0 +1,110 @@
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" }
- { tox-env: py, python-version: "3.10", os: "ubuntu-latest", external: true }
aaronsteers marked this conversation as resolved.
Show resolved Hide resolved
- { 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 }}"
aaronsteers marked this conversation as resolved.
Show resolved Hide resolved
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
114 changes: 47 additions & 67 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.