Scheduled Python CI - Python Transformer #890
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Scheduled Python CI - Python Transformer | |
on: | |
schedule: | |
- cron: "0 0 * * *" | |
jobs: | |
buildWithPythonWheel: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.9' | |
- name: Install Python deps | |
working-directory: ./Transformers/Python | |
run: | | |
pip install -r requirements.txt | |
- name: Build Python Transformer | |
working-directory: ./Transformers/Python | |
run: | | |
python3 -m build --wheel | |
- name: Test Python Transformer | |
working-directory: ./Transformers/Python | |
run: | | |
python3 -m pytest ./tests | |
buildWithDocker: | |
runs-on: ubuntu-latest | |
steps: | |
- | |
name: Checkout | |
uses: actions/checkout@v4 | |
- | |
name: Docker meta | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
# list of Docker images to use as base name for tags | |
images: | | |
ghcr.io/ciselab/lampion/python-transformer | |
# generate Docker tags based on the following events/attributes | |
tags: | | |
type=schedule | |
type=ref,event=branch | |
type=ref,event=pr | |
type=sha | |
- | |
name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- | |
name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- | |
name: Build and push | |
uses: docker/build-push-action@v5 | |
with: | |
context: ./Transformers/Python | |
push: false | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} |