Skip to content

Commit

Permalink
chore: add cicd workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
timurbazhirov committed Dec 13, 2024
1 parent 0a9cc47 commit 58009a2
Show file tree
Hide file tree
Showing 2 changed files 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-20.04
strategy:
matrix:
python-version: [3.10.12]

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-20.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 }}
publish-tag: 'false'
File renamed without changes.

0 comments on commit 58009a2

Please sign in to comment.