Skip to content

Commit

Permalink
ci: migrate to github-actions
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianpfischer committed May 25, 2024
1 parent 40f061e commit fafd6df
Show file tree
Hide file tree
Showing 5 changed files with 766 additions and 784 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,23 @@ jobs:
- name: Prerequisite installation
uses: actions/setup-python@v4
with:
python-version: '3.10'
python-version: '3.11'

- name: Install poetry
run: pip3 install poetry

# Runs the preparation
- name: Prepare working environement
- name: Prepare working environment
run: poetry install --all-extras

# Runs the test
- name: Run unittests
run: poetry run pytest --cov=./ --cov-report=xml -p no:pytest_kiso --runslow
run: poetry run coverage run -m pytest

# Run the coverage
- name: Run coverage
run: poetry run coverage xml

# Upload the test result
- name: Upload test-result to codecov
uses: codecov/codecov-action@v2
uses: codecov/codecov-action@v4
74 changes: 74 additions & 0 deletions .github/workflows/verification_validation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@

name: Verification and validation of the code

on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ master ]
pull_request:
branches: [ master ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains 2 jobs
verification_validation:
# The type of runner that the job will run on
runs-on: ubuntu-22.04

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

# Pre requisite installation
- name: Prerequisite installation
uses: actions/setup-python@v4
with:
python-version: '3.12'

- name: Install poetry
run: pip3 install poetry

# Runs the preparation
- name: Prepare working environment
run: poetry install --all-extras

# Formatting check
- name: Run format check
run: poetry run pre-commit

# Runs the tox test
- name: Run unittests (via tox)
run: poetry run tox -v run

# Run dummy test
- name: Dummy pykiso run
run: poetry run pykiso -c examples/dummy.yaml --junit

# Upload the test result
- name: Run doc
run: poetry run invoke docs

release:
runs-on: ubuntu-22.04
if: github.ref_type == 'tag'
needs: verification_validation
steps:
- uses: actions/checkout@v2

- name: Prerequisite installation
uses: actions/setup-python@v4
with:
python-version: '3.12'

- name: Install poetry
run: pip3 install poetry

- name: Prepare working environment
run: poetry install --all-extras

- name: Update to Pypi
run: poetry publish --no-interaction --build --username __token__ --password ${{ secrets.pypi_token }}
Loading

0 comments on commit fafd6df

Please sign in to comment.