Skip to content

ci: Allow build action to be triggered remotely #169

ci: Allow build action to be triggered remotely

ci: Allow build action to be triggered remotely #169

Workflow file for this run

name: Python package
on:
push:
paths-ignore:
- "**.md"
- "**.rst"
- "**.ipynb"
- "**.cff"
branches:
- main
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
paths-ignore:
- "**.md"
- "**.rst"
- "**.ipynb"
- "**.cff"
branches:
- main
workflow_call:
inputs:
caller-branch:
required: true
type: string
jobs:
build:
if: github.event.pull_request.draft == false
name: Build for (${{ matrix.python-version }}, ${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest"]
python-version: ["3.10"]
steps:
- uses: actions/checkout@v3
- name: Connect to Container Registry
uses: docker/[email protected]
with:
registry: ghcr.io
username: wbaccinelli
password: ${{ secrets.GITHUB_TOKEN }}
- name: Run Tests in Container
run: >
docker run
--rm
-v ${{ github.workspace }}:/ci
-e TEST_DATA=/eitprocessing
ghcr.io/eit-alive/eittestdata:latest
sh -c 'set -xe ;
cd /ci ;
python3 -m pip install --upgrade pip poetry ;
poetry install --with test ;
poetry run pytest -v tests/unit_tests ;
python -m build'
lint:
if: github.event.pull_request.draft == false && github.event_name != 'workflow_call'
name: Linting build
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Python info
shell: bash -e {0}
run: |
which python3
python3 --version
- name: Upgrade pip and install dependencies
run: |
python3 -m pip install --upgrade pip poetry
poetry install --with test
- name: Check linting and formatting using ruff
run: |
poetry run ruff check
poetry run ruff format --check