-
Notifications
You must be signed in to change notification settings - Fork 87
126 lines (117 loc) · 3.18 KB
/
lintrunner_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
name: Lintrunner CI
on:
pull_request:
paths:
- 'tools/lintrunner/**'
- '.github/workflows/lintrunner_ci.yml'
push:
branches:
- main
tags:
- lintrunner/v*
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}-${{ github.event_name == 'workflow_dispatch' }}
cancel-in-progress: true
jobs:
test:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest] # TODO: add back macos-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Initialize git config for testing
run: |
git config --global user.email "[email protected]"
git config --global user.name "mr fake"
- name: Install and initialize sapling on macos
if: matrix.os == 'macos-latest'
run: |
brew install sapling
sl config --user ui.username "mr fake <[email protected]>"
- name: Run cargo test
uses: nick-fields/[email protected]
env:
TMPDIR: ${{ runner.temp }}
with:
timeout_minutes: 10
max_attempts: 10
retry_wait_seconds: 90
command: |
cd tools/lintrunner
cargo test
linux:
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- uses: messense/maturin-action@v1
with:
manylinux: auto
command: build
args: --release -o dist
working-directory: tools/lintrunner
- name: Upload wheels
uses: actions/upload-artifact@v2
with:
name: wheels
path: tools/lintrunner/dist
windows:
runs-on: windows-latest
needs: test
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- uses: messense/maturin-action@v1
with:
command: build
args: --release -o dist
working-directory: tools/lintrunner
- name: Upload wheels
uses: actions/upload-artifact@v2
with:
name: wheels
path: tools/lintrunner/dist
macos:
runs-on: macos-latest
needs: test
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- uses: messense/[email protected]
with:
command: build
args: --release --target universal2-apple-darwin -o dist
working-directory: tools/lintrunner
- name: Upload wheels
uses: actions/upload-artifact@v2
with:
name: wheels
path: tools/lintrunner/dist
release:
name: Release
runs-on: ubuntu-latest
if: "startsWith(github.ref, 'refs/tags/lintrunner/v*')"
needs: [ macos, windows, linux, test ]
steps:
- uses: actions/[email protected]
with:
name: wheels
- name: Publish to PyPI
uses: messense/maturin-action@v1
env:
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
with:
command: upload
args: --skip-existing --non-interactive *