-
-
Notifications
You must be signed in to change notification settings - Fork 65
71 lines (65 loc) · 1.92 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
59
60
61
62
63
64
65
66
67
68
69
70
71
name: Linting
on:
push:
branches:
- master
- development
pull_request:
jobs:
pre-commit:
name: Pre-commit
strategy:
matrix:
python-version: ['3.9', '3.10', '3.11']
runs-on: ubuntu-latest
steps:
- name: Check out the repository
uses: actions/[email protected]
- name: Set up Python ${{ matrix.python-version }}
uses: actions/[email protected]
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: pip install -r scripts/requirements.dev.txt
- name: Run pre-commit on all files
run: |
pre-commit run --all-files --show-diff-on-failure --color=always
- name: Test with pytest
run: |
pytest -v
docker:
needs: pre-commit
runs-on: ubuntu-latest
steps:
-
name: Set up QEMU
uses: docker/[email protected]
-
name: Set up Docker Buildx
uses: docker/[email protected]
-
name: Docker meta
id: meta
uses: docker/[email protected]
with:
images: lefskiy/moonraker-telegram-bot
tags: |
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'master') }}
type=ref,event=branch
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=sha
-
name: Login to Docker Hub
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build and push
uses: docker/[email protected]
with:
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64,linux/arm/v7