feat/refactoring #425
Workflow file for this run
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: Sanity Checks | |
on: | |
pull_request: | |
types: [opened, edited, synchronize, reopened] | |
jobs: | |
pre-commit: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.11' | |
- uses: pre-commit/action@v3.0.0 | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.11' | |
- uses: arduino/setup-task@v1 | |
- name: Prepare dev env | |
shell: bash | |
run: task setup-ci | |
- name: Lint and tests | |
run: | | |
source .venv/bin/activate | |
task test | |
build-test: | |
name: "Build wheel" | |
needs: | |
- pre-commit | |
- test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.11' | |
- uses: arduino/setup-task@v1 | |
- run: task setup-ci | |
- run: task build | |
docker-build-test: | |
name: "Build docker image" | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
needs: | |
- pre-commit | |
- test | |
env: | |
IMAGE_NAME: ${{ github.repository }} | |
steps: | |
- uses: actions/checkout@v4 | |
# - name: Set up Docker Buildx | |
# uses: docker/setup-buildx-action@v3 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Docker meta | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: ghcr.io/${{env.IMAGE_NAME}} | |
flavor: | | |
latest=auto | |
prefix= | |
suffix= | |
tags: | | |
type=raw,value=${{github.ref_name}} | |
type=raw,value=latest | |
- name: Build and push | |
uses: docker/build-push-action@v5 | |
with: | |
file: containers/Dockerfile | |
push: false | |
tags: ${{ steps.meta.outputs.tags }} |