Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
126 changes: 126 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
name: CI Workflow
on:
push:
branches:
- main
tags:
- rel/**
pull_request:
branches:
- main

permissions: read-all

jobs:
lint:
name: Linting
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.10.14'

- name: Install dev dependencies
run: pip install -r requirements-dev.txt

- name: Run pre-commit linting
run: pre-commit run --all-files

system-tests:
name: System Tests
runs-on: windows-latest
needs: [tests,lint]
if: github.event_name != 'pull_request' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/rel/'))
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.10'

- name: Install test dependencies
run: pip install -r requirements-test.txt

- name: Run system tests with tox
run: tox -e system_tests
env:
DAR_CLIENT_ID: ${{ secrets.DAR_CLIENT_ID }}
DAR_CLIENT_SECRET: ${{ secrets.DAR_CLIENT_SECRET }}
DAR_AUTH_URL: ${{ secrets.DAR_AUTH_URL }}
DAR_URL: ${{ secrets.DAR_URL }}

- name: Create Github Release for Tag
if: startsWith(github.ref, 'refs/tags/rel/')
uses: softprops/action-gh-release@v2
with:
body: "Tagging release ${{ github.ref }}"
files: system_test_results/traceability.html

tests:
name: Tests on Linux, Windows and macOS environments
runs-on: ${{ matrix.os}}
strategy:
matrix:
include:
- python-version: '3.10'
toxenv: 'py310-cov'
os: ubuntu-latest
- python-version: '3.11'
toxenv: 'py311-cov'
os: ubuntu-latest
- python-version: 'pypy3.10'
toxenv: 'pypy3-cov'
os: ubuntu-latest
- python-version: '3.10'
toxenv: 'py310-cov'
os: windows-latest
- python-version: '3.10'
toxenv: 'py310-cov'
os: macos-13
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install test dependencies
run: pip install -r requirements-test.txt

- name: Run tests with tox
run: tox -e ${{ matrix.toxenv }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

deploy:
name: Deploy to PyPI
runs-on: ubuntu-latest
needs: [system-tests]
if: github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/rel/')
permissions:
contents: read
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: Build distributions
run: pipx run build --sdist --wheel

- name: Deploy release to PyPI
uses: pypa/gh-action-pypi-publish@release/v1 # Uses OIDC/Workload identities and doesn't require a token
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to be sure, did you make sure to add the trusted publisher configuration in Pypi?
(https://docs.pypi.org/trusted-publishers/adding-a-publisher/)

146 changes: 0 additions & 146 deletions .travis.yml

This file was deleted.

4 changes: 2 additions & 2 deletions requirements-test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# whitesource.
# These dependencies are never shipped, but only used locally
# on a developer's workstation or on Jenkins for development.
tox==3.23.1
tox==3.25.1
# httpretty is also referenced in tox, but listed here to make it easier to run tests
# standalone from the shell or IDE.
httpretty==1.1.4
httpretty==1.1.4
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ whitelist_externals = mkdir

# Enable parallel execution
setenv = COVERAGE_FILE = test_results/{envname}/unit_coverage/.coverage
passenv = DAR_* TRAVIS TRAVIS_* COVERALLS_*
passenv = DAR_* COVERALLS_* GITHUB_*

deps =
zipp<3.7.0 # for python 3.6 support
Expand Down