Skip to content

tests(integration): add integration test for proxy_settings #121

tests(integration): add integration test for proxy_settings

tests(integration): add integration test for proxy_settings #121

name: Test and Release
on:
push:
branches: [ "main" ]
jobs:
Unit_Test:
runs-on: ubuntu-latest
strategy:
fail-fast: true
steps:
- uses: actions/checkout@v3
- name: Setup Poetry
uses: abatilo/actions-poetry@v2
with:
poetry-version: 1.3.2
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.11
cache: "poetry"
- name: Install Dependencies
run: poetry install
- name: Test with PyTest
run: poetry run coverage run -m pytest -m "not integration"
env:
COVERAGE_FILE: unit_test.coverage
- uses: actions/upload-artifact@master
with:
name: unit-cov
path: unit_test.coverage
Integration_Test:
runs-on: ubuntu-latest
strategy:
fail-fast: true
steps:
- uses: actions/checkout@v3
- name: Setup Poetry
uses: abatilo/actions-poetry@v2
with:
poetry-version: 1.3.2
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.11
cache: "poetry"
- name: Install Dependencies
run: poetry install
- name: Test with PyTest
run: poetry run coverage run -m pytest -m "integration"
env:
COVERAGE_FILE: integration.coverage
- uses: actions/upload-artifact@master
with:
name: int-cov
path: integration.coverage
Validate:
runs-on: ubuntu-latest
needs:
- Unit_Test
- Integration_Test
strategy:
fail-fast: true
steps:
- uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Install coverage
run: pip install coverage
- uses: actions/download-artifact@master
name: Download Unit Test results
id: download_unit
with:
name: unit-cov
path: unit_test.coverage
- uses: actions/download-artifact@master
name: Download Integration Test results
id: download_int
with:
name: int-cov
path: integration.coverage
- name: Combine test results
run: |
coverage combine ${{steps.download_unit.outputs.download-path}}/*.coverage ${{steps.download_int.outputs.download-path}}/*.coverage
coverage report --show-missing --include "src/boinc_client/*" --omit src/boinc_client/clients/rpc_client.py --fail-under 100
Release:
runs-on: ubuntu-latest
needs:
- Validate
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.GH_TOKEN }}
- name: Setup Poetry
uses: abatilo/actions-poetry@v2
with:
poetry-version: 1.3.2
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.11
cache: "poetry"
- name: Get Next Version
id: semver
uses: ietf-tools/semver-action@v1
with:
branch: main
patchList: fix,bugfix,security
noVersionBumpBehavior: silent
token: ${{ secrets.GH_TOKEN }}
- name: Bump Poetry Version
run: poetry version ${{ steps.semver.outputs.nextStrict }}
- name: Commit Release to repo
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: |
Create ${{ steps.semver.outputs.next }} Release
[skip ci]
tagging_message: ${{ steps.semver.outputs.next }}
- name: Create Release
uses: ncipollo/release-action@v1
if: ${{ steps.semver.outputs.next != null }}
with:
name: ${{ steps.semver.outputs.next }}
body: Changelog Contents
tag: ${{ steps.semver.outputs.next }}
token: ${{ github.token }}
makeLatest: true
generateReleaseNotes: true
skipIfReleaseExists: true
- name: Build Library
if: ${{ steps.semver.outputs.next != null }}
run: poetry build
- name: Publish Library
if: ${{ steps.semver.outputs.next != null }}
run: poetry publish --username __token__ --password ${{ secrets.PYPI_TOKEN }}