Skip to content

Commit

Permalink
feat: add GH WF
Browse files Browse the repository at this point in the history
  • Loading branch information
timurbazhirov committed Dec 13, 2024
1 parent 0b8a989 commit 28d7ec5
Showing 1 changed file with 89 additions and 0 deletions.
89 changes: 89 additions & 0 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# Work in progress, needs `camsai/actions` repository to be present
name: Continuous Testing and Publication

on: [push]

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
run-py-linter:
runs-on: ubuntu-22.04
strategy:
matrix:
python-version:
- 3.10.x

steps:
- name: Checkout this repository
uses: actions/checkout@v4
with:
lfs: true

- name: Checkout actions repository
uses: actions/checkout@v4
with:
repository: camsai/actions
token: ${{ secrets.GITHUB_TOKEN }}
path: actions

- name: Run ruff linter
uses: ./actions/py/lint
with:
python-version: ${{ matrix.python-version }}

run-py-tests:
needs: run-py-linter
runs-on: ubuntu-22.04
strategy:
matrix:
python-version:
- 3.10.x
- 3.11.x

steps:
- name: Checkout this repository
uses: actions/checkout@v4
with:
lfs: true

- name: Checkout actions repository
uses: actions/checkout@v4
with:
repository: camsai/actions
token: ${{ secrets.GITHUB_TOKEN }}
path: actions

- name: Run python unit tests
uses: ./actions/py/pytest
with:
python-version: ${{ matrix.python-version }}
unit-test-directory: tests/py/unit

publish-py-package:
needs:
- run-py-tests
- run-py-linter
runs-on: ubuntu-latest
if: (github.ref_name == 'main')

steps:
- name: Checkout this repository
uses: actions/checkout@v4
with:
lfs: true

- name: Checkout actions repository
uses: actions/checkout@v4
with:
repository: camsai/actions
token: ${{ secrets.GITHUB_TOKEN }}
path: actions

- name: Publish python release
uses: ./actions/py/publish
with:
python-version: 3.10.12
github-token: ${{ secrets.GITHUB_TOKEN }}
pypi-api-token: ${{ secrets.PYPI_API_TOKEN }}

0 comments on commit 28d7ec5

Please sign in to comment.