Skip to content

Commit

Permalink
ci: PLT-268: add codecov upload
Browse files Browse the repository at this point in the history
  • Loading branch information
farioas committed Mar 19, 2024
1 parent 2bcce8c commit 6a4cf33
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 50 deletions.
74 changes: 24 additions & 50 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,75 +34,49 @@ jobs:
- name: Set up poetry
uses: snok/install-poetry@v1
with:
python-version: '3.9'
python-version: '3.11'
cache: true

- name: Install Python dependencies
run: |
poetry install
run: poetry install

- name: Run black
run: |
poetry run pytest --black .
run: poetry run pytest --black .

run_pytest_ubuntu:
name: Ubuntu
runs-on: ubuntu-latest
run_pytest:
name: Pytest ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version:
- '3.8'
- '3.9'
- '3.10'
- '3.11'
include:
- os: ubuntu-latest
python-version: ['3.8', '3.9', '3.10', '3.11']
test-command: poetry run pytest --junitxml report.xml --cov=. -vv
- os: windows-latest
python-version: ['3.8', '3.9', '3.10', '3.11']
test-command: poetry run pytest -vv

steps:
- uses: actions/checkout@v4

- name: Set up poetry
uses: snok/install-poetry@v1
with:
python-version: "${{ matrix.python-version }}"
python-version: ${{ matrix.python-version }}
cache: true

- name: Install Python dependencies
run: |
poetry install
- name: Run functional tests
run: |
cd tests/
poetry run pytest --junitxml report.xml --cov=. -vv
run: poetry install

run_pytests_windows:
name: Windows
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
python-version:
- '3.8'
- '3.9'
- '3.10'
- '3.11'

steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ inputs.head_sha }}
- name: Run tests
working-directory: tests/
run: ${{ matrix.test-command }}

- name: Set up poetry
uses: snok/install-poetry@v1
- name: Upload to Codecov
if: matrix.os == 'ubuntu-latest && python-version == '3.11'
uses: codecov/[email protected]
with:
python-version: "${{ matrix.python-version }}"
cache: true

- name: Install Python dependencies
run: |
poetry install
- name: Test with pytest
run: |
poetry run pytest -vv
files: tests/coverage.xml
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -171,3 +171,5 @@ pyrightconfig.json

# actions-hub
.github/actions-hub

.idea/
2 changes: 2 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
fixes:
- "/home/runner/work/Adala/Adala/::"

0 comments on commit 6a4cf33

Please sign in to comment.