Skip to content

rename workflows, fix CI so it can be called by others. #2

rename workflows, fix CI so it can be called by others.

rename workflows, fix CI so it can be called by others. #2

Workflow file for this run

name: CI Pipeline

Check failure on line 1 in .github/workflows/ci.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/ci.yml

Invalid workflow file

(Line: 49, Col: 5): 'if' is already defined
on:
workflow_call:
inputs:
run_publish:
type: boolean
default: false
jobs:
lint:
runs-on: ubuntu-latest
container:
image: python:3.12-slim
steps:
- uses: actions/checkout@v4
- name: Install build tools
run: apt-get update && apt-get install -y gcc build-essential
- name: Install Poetry
run: pip install poetry
- name: Install dependencies
run: poetry install --with dev
- name: Lint with flake8 and pylint
run: |
poetry run flake8 ccsds
poetry run pylint ccsds
test:
runs-on: ubuntu-latest
container:
image: python:3.12-slim
steps:
- uses: actions/checkout@v4
- name: Install build tools
run: apt-get update && apt-get install -y gcc build-essential
- name: Install Poetry
run: pip install poetry
- name: Install dependencies
run: poetry install
- name: Run tests
run: poetry run pytest
publish:
if: ${{ inputs.run_publish }}
needs: [lint, test]
runs-on: ubuntu-latest
container:
image: python:3.12-slim
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v4
- name: Install build tools
run: apt-get update && apt-get install -y gcc build-essential
- name: Install Poetry
run: pip install poetry
- name: Install dependencies
run: poetry install
- name: Build and publish to PyPI
env:
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }}
run: poetry publish --build --no-interaction --repository testpypi