build and push on main #3
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: Build and test | |
on: | |
push | |
jobs: | |
cancel-previous: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: styfle/[email protected] | |
with: | |
access_token: ${{ github.token }} | |
build-and-test: | |
name: pytest | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout code | |
uses: actions/checkout@v4 | |
- name: set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.11' | |
- name: install poetry | |
run: | | |
python -m pip install --no-cache-dir poetry==1.8 supervisor | |
- name: set up docker | |
run: make gha-setup | |
- name: Log in to GitHub Container Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Clean previous builds | |
run: rm -rf dist/*.whl | |
- name: Build with Poetry | |
run: poetry build | |
- name: Build docker image | |
run: make build | |
- name: run tests | |
run: make test |