-
-
Notifications
You must be signed in to change notification settings - Fork 1
130 lines (123 loc) · 3.39 KB
/
ci.yml
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
name: ci
on:
push:
branches:
- main
- release/**
pull_request:
jobs:
format:
name: "Code formatting"
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v2
- name: Internal github app token
id: token
uses: getsentry/action-github-app-token@97c9e23528286821f97fba885c1b1123284b29cc # v2.0.0
continue-on-error: true
with:
app_id: ${{ vars.SENTRY_INTERNAL_APP_ID }}
private_key: ${{ secrets.SENTRY_INTERNAL_APP_PRIVATE_KEY }}
- uses: actions/setup-python@v2
with:
python-version: 3.8
- run: make install format
- uses: getsentry/action-github-commit@bec0adb2924f8c19a9f84c18c83d375caf02ca38 # main
if: github.event_name == 'pull_request'
with:
github-token: ${{ steps.token.outputs.token }}
- run: git diff --quiet || (echo '::error ::lint produced file changes, run linter locally and try again' && exit 1)
lint-rust:
name: "Linters (Rust)"
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v2
name: Checkout code
- uses: actions/cache@v3
name: Restore build cache
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Run linter
run: |
make lint-rust
lint-python:
name: "Linters (Python)"
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v2
name: Checkout code
- uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
make install
- name: Run linter
run: |
make lint-python
typing:
name: "Type checking"
runs-on: ubuntu-latest
timeout-minutes: 2
steps:
- uses: actions/checkout@v2
name: Checkout code
- uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
make install
- name: Run mypy
run: |
make type-checking
tests:
name: "Run tests"
runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python: [3.8, 3.9, "3.10", "3.11"]
timeout-minutes: 10
steps:
- uses: actions/checkout@v2
name: Checkout code
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
make install
- name: Run tests
run: make tests
tests-rust:
name: "Run tests (Rust)"
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v2
name: Checkout code
- uses: actions/cache@v3
name: Restore build cache
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-test-${{ hashFiles('**/Cargo.lock') }}
- name: Run tests
run: make tests-rust