added publish workflow
This commit is contained in:
@@ -0,0 +1,44 @@
|
|||||||
|
name: CI Pipeline
|
||||||
|
run-name: Build and Publish Pipeline
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
name: Test
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout Code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
- name: Setup Environment
|
||||||
|
uses: https://github.com/actions/setup-python@v3
|
||||||
|
with:
|
||||||
|
python-verison: "3.12"
|
||||||
|
architecture: "x64"
|
||||||
|
- name: Install Packages
|
||||||
|
run: |
|
||||||
|
pip install poetry
|
||||||
|
poetry install
|
||||||
|
- name: PEP8 Check
|
||||||
|
run: |
|
||||||
|
poetry run flake8 ./src --benchmark
|
||||||
|
- name: Type Check
|
||||||
|
run: |
|
||||||
|
poetry run mypy ./src --disable-error-code=import-untyped
|
||||||
|
publish:
|
||||||
|
name: Build and Publish
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: [test]
|
||||||
|
steps:
|
||||||
|
- name: Checkout Code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
- name: Set Environment Variables
|
||||||
|
run: |
|
||||||
|
echo "sha_short=$(git rev-parse --short "$GITEA_SHA")" >> "$GITEA_ENV"
|
||||||
|
echo "branch=$(echo ${GITEA_REF#refs/heads/})" >> "$GITEA_ENV"
|
||||||
|
- name: Print Env Vars
|
||||||
|
run: |
|
||||||
|
echo "Branch: ${{ env.branch }}"
|
||||||
|
echo "Sha: ${{ env.sha_short }}"
|
||||||
Reference in New Issue
Block a user