-
Notifications
You must be signed in to change notification settings - Fork 0
114 lines (108 loc) · 3.31 KB
/
checks.yml
File metadata and controls
114 lines (108 loc) · 3.31 KB
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
name: process_pull_request
on:
push:
branches: [main]
pull_request: null
jobs:
build_linter_image:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build linter image
uses: docker/build-push-action@v6
with:
context: .
file: .docker/lint.Dockerfile
target: runtime
cache-from: type=gha,scope=${{ github.ref_name }}
cache-to: type=gha,mode=max,scope=${{ github.ref_name }}
outputs: type=docker,dest=/tmp/linter_image.tar
tags: linter:latest
- name: Upload linter image
uses: actions/upload-artifact@v4
with:
name: linter-image
path: /tmp/linter_image.tar
retention-days: 1
run_ruff_check:
runs-on: ubuntu-latest
needs: build_linter_image
steps:
- name: Download linter image
uses: actions/download-artifact@v4
with:
name: linter-image
path: /tmp
- name: Load image
run: docker load -i /tmp/linter_image.tar
- name: Run ruff check
run: docker run linter:latest ruff check --output-format=github
run_ruff_format:
runs-on: ubuntu-latest
needs: build_linter_image
steps:
- name: Download linter image
uses: actions/download-artifact@v4
with:
name: linter-image
path: /tmp
- name: Load image
run: docker load -i /tmp/linter_image.tar
- name: Run ruff format
run: docker run linter:latest ruff format --check
run_mypy:
runs-on: ubuntu-latest
needs: build_linter_image
steps:
- name: Download linter image
uses: actions/download-artifact@v4
with:
name: linter-image
path: /tmp
- name: Load image
run: docker load -i /tmp/linter_image.tar
- name: Run mypy
run: docker run linter:latest mypy .
build_test_image:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build test image
uses: docker/build-push-action@v6
with:
context: .
file: .docker/test.Dockerfile
target: runtime
cache-from: type=gha,scope=${{ github.ref_name }}
cache-to: type=gha,mode=max,scope=${{ github.ref_name }}
outputs: type=docker,dest=/tmp/test_image.tar
tags: test:latest
- name: Upload test image
uses: actions/upload-artifact@v4
with:
name: test-image
path: /tmp/test_image.tar
retention-days: 1
run_tests:
runs-on: ubuntu-latest
needs: build_test_image
env:
TAG: test:latest # Injected into docker-compose.remote.test.yml as ${TAG}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Download test image
uses: actions/download-artifact@v4
with:
name: test-image
path: /tmp
- name: Load image
run: docker load -i /tmp/test_image.tar
- name: Run tests
run: docker compose -f docker-compose.remote.test.yml up --no-log-prefix --attach md-test --exit-code-from md-test