-
Notifications
You must be signed in to change notification settings - Fork 2
58 lines (55 loc) · 1.57 KB
/
ci.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: CI
on: push
env:
PYTHON_VERSION: "3.10"
POETRY_VERSION: "1.3.2"
POETRY_HOME: "~/.poetry"
jobs:
linters:
name: "${{ matrix.linter }}"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
linter: ["isort", "black", "mypy", "flake8"]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup project
uses: ./.github/actions/setup-project
- name: Run ${{ matrix.linter }}
run: make ${{ matrix.linter }}
pytest:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup project
uses: ./.github/actions/setup-project
- name: Run pytest
run: pytest -v
docker:
runs-on: ubuntu-latest
needs: [linters, pytest]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: ghcr.io/${{ github.repository }}
- name: Build docker image
uses: docker/build-push-action@v3
with:
push: ${{ startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}