-
Notifications
You must be signed in to change notification settings - Fork 0
162 lines (151 loc) · 4.36 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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
name: CI
on:
push:
branches:
- '*'
pull_request:
jobs:
report:
needs:
- lint-aux
- extract-changelog
- rustfmt
- clippy
- build-and-test
- package-crate
- build-dist-linux
- build-dist-windows
- build-dist-book
# 'always()' is needed because GitHub treats a skipped job (due to a failed
# dependency) a success.
if: always()
runs-on: ubuntu-22.04
steps:
- name: Report status
env:
NEEDS_JSON: ${{ toJson(needs) }}
# Make sure all dependencies succeeded.
run: jq --exit-status 'all(.result == "success")' <<< "$NEEDS_JSON"
lint-aux:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Install lint utilities
run: sudo npm install -g [email protected] [email protected]
- name: Install Rust
run: ./ci/install-rust.sh stable --profile minimal
- run: ./ci/lint-aux.sh
extract-changelog:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Install Rust
run: ./ci/install-rust.sh stable --profile minimal
- run: ./ci/extract-changelog.sh
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: version-changelog
path: version-changelog
if-no-files-found: error
rustfmt:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Install Rust
run: ./ci/install-rust.sh stable --profile minimal -c rustfmt
- run: cargo fmt --all -- --check
clippy:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Install Rust
run: ./ci/install-rust.sh stable --profile minimal -c clippy
- run: ./ci/clippy.sh
build-and-test:
runs-on: ubuntu-22.04
strategy:
matrix:
include:
- rust-version: msrv
- rust-version: stable
steps:
- uses: actions/checkout@v4
- name: Install Rust
run: ./ci/install-rust.sh "${{ matrix.rust-version }}" --profile minimal
- run: ./ci/build-and-test.sh
package-crate:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Install Rust
run: ./ci/install-rust.sh stable --profile minimal
- run: ./ci/package-crate.sh
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: packaged-crate
path: output
if-no-files-found: error
build-dist-linux:
runs-on: ubuntu-22.04
env:
DOCKER_IMAGE: quay.io/pypa/manylinux2014_x86_64
steps:
- uses: actions/checkout@v4
- name: Pull Docker image ${{ env.DOCKER_IMAGE }}
run: docker pull "$DOCKER_IMAGE"
- name: Run Docker container
run: |
docker run \
-v "$(pwd):/workdir" \
-w /workdir \
"$DOCKER_IMAGE" \
bash ./ci/build-dist-linux.sh
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: dist-linux
path: |
output/svn2git-linux-x86_64.tar.gz
output/svn2git-linux-i686.tar.gz
if-no-files-found: error
build-dist-windows:
runs-on: ubuntu-22.04
env:
DOCKER_IMAGE: debian:12-slim
steps:
- uses: actions/checkout@v4
- name: Pull Docker image ${{ env.DOCKER_IMAGE }}
run: docker pull "$DOCKER_IMAGE"
- name: Run Docker container
run: |
docker run \
-v "$(pwd):/workdir" \
-w /workdir \
"$DOCKER_IMAGE" \
bash ./ci/build-dist-windows.sh
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: dist-windows
path: |
output/svn2git-windows-x86_64.zip
output/svn2git-windows-i686.zip
if-no-files-found: error
build-dist-book:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Install Rust
run: ./ci/install-rust.sh stable --profile minimal
- name: Install mdbook
run: cargo install --locked --version 0.4.40 mdbook
- name: Build book
run: ./ci/build-dist-book.sh
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: dist-book
path: book/svn2git-book.zip
if-no-files-found: error