-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5227a0f
commit 7511a69
Showing
2 changed files
with
63 additions
and
21 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 |
---|---|---|
@@ -1,35 +1,43 @@ | ||
name: CI | ||
name: "CI" | ||
|
||
permissions: "read-all" | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- "main" | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
defaults: | ||
run: | ||
shell: "bash" | ||
|
||
env: | ||
FORCE_COLOR: "1" | ||
|
||
jobs: | ||
coverage: | ||
runs-on: ubuntu-latest | ||
env: | ||
OS: ubuntu-latest | ||
PYTHON: '3.9' | ||
test: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: ["3.9", "3.10", "3.11", "3.12"] | ||
|
||
name: "Test (${{ matrix.python-version }})" | ||
runs-on: "ubuntu-latest" | ||
continue-on-error: false | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: "Checkout repository" | ||
uses: "actions/checkout@v4" | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v4 | ||
- name: "Setup Python" | ||
uses: "actions/setup-python@v4" | ||
with: | ||
python-version: 3.9 | ||
python-version: "${{ matrix.python-version }}" | ||
|
||
- name: Generate coverage report | ||
- name: "Run tests" | ||
run: | | ||
python -m pip install poetry | ||
poetry install --with test | ||
poetry run pytest --cov=src/powerline_k8s --cov-report=xml | ||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v3 | ||
with: | ||
files: ./coverage.xml | ||
env_vars: OS,PYTHON | ||
fail_ci_if_error: true | ||
verbose: true | ||
poetry run pytest |
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,34 @@ | ||
name: "Codecov" | ||
|
||
on: [push] | ||
|
||
jobs: | ||
coverage: | ||
runs-on: "ubuntu-latest" | ||
env: | ||
OS: "ubuntu-latest" | ||
PYTHON: '3.10' | ||
environment: | ||
name: "codecov" | ||
steps: | ||
- uses: "actions/checkout@master" | ||
|
||
- name: "Setup Python" | ||
uses: "actions/setup-python@master" | ||
with: | ||
python-version: "3.10" | ||
|
||
- name: "Generate coverage report" | ||
run: | | ||
pip install pytest | ||
pip install pytest-cov | ||
pytest --cov=./ --cov-report=xml | ||
- name: "Upload coverage to Codecov" | ||
uses: "codecov/codecov-action@v4" | ||
with: | ||
files: ./coverage.xml | ||
env_vars: OS,PYTHON | ||
fail_ci_if_error: true | ||
verbose: true | ||
token: ${{ secrets.CODECOV_TOKEN }} |