6
6
- master
7
7
schedule :
8
8
- cron : ' 00 01 * * *'
9
+
10
+ # The section is needed to drop write-all permissions that are granted on
11
+ # `schedule` event. By specifying any permission explicitly all others are set
12
+ # to none. By using the principle of least privilege the damage a compromised
13
+ # workflow can do (because of an injection or compromised third party tool or
14
+ # action) is restricted. Currently the worklow doesn't need any additional
15
+ # permission except for pulling the code. Adding labels to issues, commenting
16
+ # on pull-requests, etc. may need additional permissions:
17
+ #
18
+ # Syntax for this section:
19
+ # https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions
20
+ #
21
+ # Reference for how to assign permissions on a job-by-job basis:
22
+ # https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs
23
+ #
24
+ # Reference for available permissions that we can enable if needed:
25
+ # https://docs.github.com/en/actions/security-guides/automatic-token-authentication#permissions-for-the-github_token
26
+ permissions :
27
+ # to fetch code (actions/checkout)
28
+ contents : read
29
+
9
30
jobs :
10
31
test :
11
32
name : test
@@ -14,32 +35,21 @@ jobs:
14
35
# systems.
15
36
CARGO : cargo
16
37
# When CARGO is set to CROSS, this is set to `--target matrix.target`.
38
+ # Note that we only use cross on Linux, so setting a target on a
39
+ # different OS will just use normal cargo.
17
40
TARGET_FLAGS :
18
41
# When CARGO is set to CROSS, TARGET_DIR includes matrix.target.
19
42
TARGET_DIR : ./target
43
+ # Bump this as appropriate. We pin to a version to make sure CI
44
+ # continues to work as cross releases in the past have broken things
45
+ # in subtle ways.
46
+ CROSS_VERSION : v0.2.5
20
47
# Emit backtraces on panics.
21
48
RUST_BACKTRACE : 1
22
49
runs-on : ${{ matrix.os }}
23
50
strategy :
51
+ fail-fast : false
24
52
matrix :
25
- build :
26
- # We test ripgrep on a pinned version of Rust, along with the moving
27
- # targets of 'stable' and 'beta' for good measure.
28
- - pinned
29
- - stable
30
- - beta
31
- # Our release builds are generated by a nightly compiler to take
32
- # advantage of the latest optimizations/compile time improvements. So
33
- # we test all of them here. (We don't do mips releases, but test on
34
- # mips for big-endian coverage.)
35
- - nightly
36
- - nightly-musl
37
- - nightly-32
38
- - nightly-mips
39
- - nightly-arm
40
- - macos
41
- - win-msvc
42
- - win-gnu
43
53
include :
44
54
- build : pinned
45
55
os : ubuntu-latest
@@ -53,27 +63,26 @@ jobs:
53
63
- build : nightly
54
64
os : ubuntu-latest
55
65
rust : nightly
56
- - build : nightly -musl
66
+ - build : stable -musl
57
67
os : ubuntu-latest
58
- rust : nightly
68
+ rust : stable
59
69
target : x86_64-unknown-linux-musl
60
- - build : nightly-32
70
+ - build : stable-x86
61
71
os : ubuntu-latest
62
- rust : nightly
72
+ rust : stable
63
73
target : i686-unknown-linux-gnu
64
- - build : nightly-mips
74
+ - build : stable-aarch64
65
75
os : ubuntu-latest
66
- rust : nightly
67
- target : mips64 -unknown-linux-gnuabi64
68
- - build : nightly-arm
76
+ rust : stable
77
+ target : aarch64 -unknown-linux-gnu
78
+ - build : stable-powerpc64
69
79
os : ubuntu-latest
70
- rust : nightly
71
- # For stripping release binaries:
72
- # docker run --rm -v $PWD/target:/target:Z \
73
- # rustembedded/cross:arm-unknown-linux-gnueabihf \
74
- # arm-linux-gnueabihf-strip \
75
- # /target/arm-unknown-linux-gnueabihf/debug/rg
76
- target : arm-unknown-linux-gnueabihf
80
+ rust : stable
81
+ target : powerpc64-unknown-linux-gnu
82
+ - build : stable-s390x
83
+ os : ubuntu-latest
84
+ rust : stable
85
+ target : s390x-unknown-linux-gnu
77
86
- build : macos
78
87
os : macos-latest
79
88
rust : nightly
@@ -103,9 +112,17 @@ jobs:
103
112
toolchain : ${{ matrix.rust }}
104
113
105
114
- name : Use Cross
106
- if : matrix.target != ''
115
+ if : matrix.os == 'ubuntu-latest' && matrix. target != ''
107
116
run : |
108
- cargo install cross
117
+ # In the past, new releases of 'cross' have broken CI. So for now, we
118
+ # pin it. We also use their pre-compiled binary releases because cross
119
+ # has over 100 dependencies and takes a bit to compile.
120
+ dir="$RUNNER_TEMP/cross-download"
121
+ mkdir "$dir"
122
+ echo "$dir" >> $GITHUB_PATH
123
+ cd "$dir"
124
+ curl -LO "https://github.com/cross-rs/cross/releases/download/$CROSS_VERSION/cross-x86_64-unknown-linux-musl.tar.gz"
125
+ tar xf cross-x86_64-unknown-linux-musl.tar.gz
109
126
echo "CARGO=cross" >> $GITHUB_ENV
110
127
echo "TARGET_FLAGS=--target ${{ matrix.target }}" >> $GITHUB_ENV
111
128
echo "TARGET_DIR=./target/${{ matrix.target }}" >> $GITHUB_ENV
@@ -177,7 +194,6 @@ jobs:
177
194
run : ci/test-complete
178
195
179
196
rustfmt :
180
- name : rustfmt
181
197
runs-on : ubuntu-latest
182
198
steps :
183
199
- name : Checkout repository
@@ -191,7 +207,6 @@ jobs:
191
207
run : cargo fmt --all --check
192
208
193
209
docs :
194
- name : Docs
195
210
runs-on : ubuntu-latest
196
211
steps :
197
212
- name : Checkout repository
0 commit comments