Skip to content

Commit d0fa219

Browse files
committed
Add 'update crates versions' workflow & update docker build
1 parent 76dcd97 commit d0fa219

File tree

5 files changed

+290
-27
lines changed

5 files changed

+290
-27
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Update crates versions
2+
3+
defaults:
4+
run:
5+
shell: bash
6+
7+
on:
8+
schedule:
9+
# * is a special character in YAML, needs quoting
10+
- cron: '0 0 * * 0'
11+
workflow_dispatch:
12+
13+
jobs:
14+
updateversions:
15+
runs-on: ubuntu-latest
16+
container:
17+
image: rust:latest
18+
steps:
19+
- name: Check out the code
20+
uses: actions/checkout@v2
21+
with:
22+
fetch-depth: 0
23+
- name: Retrieve newest versions of dependencies
24+
run: |
25+
echo 'cargo_toml<<EOF' >> $GITHUB_ENV
26+
./bin/update-crates-versions.sh | sed 's/"/\\"/g' >> $GITHUB_ENV
27+
echo 'EOF' >> $GITHUB_ENV
28+
- name: Update Cargo.toml
29+
run:
30+
echo "${{env.cargo_toml}}" > local-registry/Cargo.toml
31+
- name: Create Pull Request
32+
id: cpr
33+
uses: peter-evans/create-pull-request@v3
34+
with:
35+
commit-message: Update crates versions
36+
committer: GitHub <[email protected]>
37+
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
38+
branch: update-crates-version
39+
title: Update crates versions
40+
body: |
41+
Update crates versions
42+
43+
This is an auto-generated pull request.

Dockerfile

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ RUN rm src/lib.rs
2222
COPY src/* src/
2323
# build the executable
2424
RUN cargo build --release
25-
COPY bin/generate-registry.sh ${wd}/bin/
2625
# download jq
2726
RUN curl -L -o /usr/local/bin/jq "${JQ_URL}" \
2827
&& chmod +x /usr/local/bin/jq
@@ -34,7 +33,7 @@ RUN curl -L -o clr.tar.gz "${CLR_URL}" \
3433
# download popular crates to local registry
3534
WORKDIR /local-registry
3635
COPY local-registry/* ./
37-
RUN ${wd}/bin/generate-registry.sh
36+
RUN cargo generate-lockfile && cargo local-registry --sync Cargo.lock .
3837

3938
# As of Dec 2019, we need to use the nightly toolchain to get JSON test output
4039
FROM rustlang/rust:nightly AS test
@@ -53,6 +52,4 @@ replace-with = "local-registry"\n\
5352
local-registry = "/opt/test-runner/local-registry/"\n' >> $CARGO_HOME/config.toml
5453
# set entrypoint
5554
COPY bin/run.sh bin
56-
COPY --from=build /usr/local/cargo/bin/cargo-local-registry /usr/local/cargo/bin/
57-
COPY bin/generate-registry.sh bin
5855
ENTRYPOINT ["bin/run.sh"]

bin/generate-registry.sh

Lines changed: 0 additions & 23 deletions
This file was deleted.

bin/update-crates-versions.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/usr/bin/env bash
2+
3+
MANIFEST=local-registry/Cargo.toml
4+
DEP_LINE=$(grep -n "\[dependencies\]" $MANIFEST | cut -d : -f 1)
5+
DEPS=$(tail -n +$(($DEP_LINE + 1)) $MANIFEST)
6+
7+
while IFS= read -r line
8+
do
9+
crate=$(echo "$line" | awk -F"[ ]+" '{print $1}')
10+
>&2 echo "Retrieving latest version of $crate..."
11+
latest_version=$(cargo search "$crate" | head -n 1 | awk -F"[ ]+" '{print $1 " = " $3}')
12+
sed -i -r "s/^$crate =.*/$latest_version/" $MANIFEST
13+
done <<< "$DEPS"
14+
15+
cat $MANIFEST

local-registry/Cargo.toml

Lines changed: 231 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,234 @@ edition = "2021"
77
path = "dummy.rs"
88

99
[dependencies]
10+
unicode-segmentation = "1.8.0"
11+
chrono = "0.4.19"
12+
itertools = "0.10.3"
13+
rand = "0.8.4"
14+
regex = "1.5.4"
15+
lazy_static = "1.4.0"
16+
rayon = "1.5.1"
17+
time = "0.3.5"
18+
num = "0.4.0"
19+
unicode-reverse = "1.0.8"
20+
maplit = "1.0.2"
21+
crossbeam = "0.8.1"
22+
num-traits = "0.2.14"
23+
primes = "0.3.0"
24+
num-bigint = "0.4.3"
25+
modulo = "0.1.2"
26+
criterion = "0.3.5"
27+
num-integer = "0.1.44"
28+
crossbeam-utils = "0.8.5"
29+
bit-vec = "0.6.3"
30+
strum = "0.23.0"
31+
strum_macros = "0.23.1"
32+
primal = "0.3.0"
33+
once_cell = "1.8.0"
34+
failure = "0.1.8"
35+
counter = "0.5.2"
36+
permutator = "0.4.0"
37+
rstest = "0.11.0"
38+
crossbeam-channel = "0.5.1"
39+
bitflags = "1.3.2"
40+
permutohedron = "0.2.4"
41+
num-derive = "0.3.3"
42+
ndarray = "0.15.4"
43+
anyhow = "1.0.51"
44+
nom = "7.1.0"
45+
threadpool = "1.8.1"
46+
cached = "0.26.2"
47+
unicase = "2.6.0"
48+
phf = "0.10.0"
49+
libmath = "0.2.1"
50+
unicode-normalization = "0.1.19"
51+
rstest_reuse = "0.1.3"
52+
petgraph = "0.6.0"
53+
im = "15.0.0"
54+
hexlit = "0.5.3"
55+
enum-iterator = "0.7.0"
56+
boolinator = "2.4.0"
57+
uuid = "1.0.0-alpha.1"
58+
num_enum = "0.5.4"
59+
duplicate = "0.3.0"
60+
divrem = "1.0.0"
61+
pest = "2.1.3"
62+
modinverse = "0.1.1"
63+
dashmap = "4.0.2"
64+
bit-set = "0.5.2"
65+
bimap = "0.6.1"
66+
voca_rs = "1.14.0"
67+
unic-segment = "0.9.0"
68+
thiserror = "1.0.30"
69+
multiset = "0.0.5"
70+
kmp = "0.1.1"
71+
gcd = "2.0.2"
72+
fnv = "1.0.7"
73+
derivative = "2.2.0"
74+
ascii = "1.0.0"
75+
unicode_reader = "1.0.2"
76+
unic-char-range = "0.9.0"
77+
structopt = "0.3.25"
78+
scan_fmt = "0.2.6"
79+
pretty_assertions = "1.0.0"
80+
pest_derive = "2.1.0"
81+
multimap = "0.8.3"
82+
try_opt = "0.2.0"
83+
integer-sqrt = "0.1.5"
84+
int-enum = "0.4.0"
85+
indexmap = "1.7.0"
86+
hashers = "1.0.1"
87+
grapheme = "0.0.0"
88+
factorial = "0.2.1"
89+
eval = "0.4.3"
90+
derive_more = "0.99.17"
91+
counted-array = "0.1.2"
92+
case = "1.0.0"
93+
bitvec = "1.0.0-rc1"
94+
arrayvec = "0.7.2"
95+
Inflector = "0.11.4"
96+
watch = "0.2.0"
97+
stringsort = "2.0.0"
98+
serde = "1.0.130"
99+
rusqlite = "0.26.1"
100+
reikna = "0.12.3"
101+
modexp = "0.2.2"
102+
mod_exp = "1.0.1"
103+
lazysort = "0.2.1"
104+
evalexpr = "6.6.0"
105+
enumflags2 = "0.7.1"
106+
enum_derive = "0.1.7"
107+
custom_derive = "0.1.7"
108+
char_stream = "0.1.8"
109+
bytecount = "0.6.2"
110+
bencher = "0.1.5"
111+
unzip-n = "0.1.2"
112+
unic-normal = "0.9.0"
113+
transpose = "0.2.1"
114+
test-case = "1.2.1"
115+
subslice = "0.2.3"
116+
strfmt = "0.1.6"
117+
slow_primes = "0.1.14"
118+
serde_derive = "1.0.130"
119+
say-number = "1.0.0"
120+
rustversion = "1.0.6"
121+
rs_poker = "2.0.0-alpha.1"
122+
recur-fn = "2.2.0"
123+
readonly = "0.2.0"
124+
rand_chacha = "0.3.1"
125+
ramp = "0.6.0"
126+
quickcheck_macros = "1.0.0"
127+
quickcheck = "1.0.3"
128+
proptest = "1.0.0"
129+
prime_tools = "0.3.4"
130+
peg = "0.7.0"
131+
pcre = "0.2.3"
132+
ordered-float = "2.8.0"
133+
onig = "6.3.1"
134+
num_cpus = "1.13.0"
135+
luhn = "1.0.1"
136+
linked_hash_set = "0.1.4"
137+
linked-hash-map = "0.5.4"
138+
libm = "0.2.1"
139+
inflections = "1.1.1"
140+
indicatif = "0.17.0-beta.1"
141+
imageproc = "0.22.0"
142+
image = "0.23.14"
143+
if_chain = "1.0.2"
144+
hashbag = "0.1.4"
145+
generational-arena = "0.2.8"
146+
frunk = "0.4.0"
147+
factor = "0.4.0"
148+
enum-primitive-derive = "0.2.2"
149+
either = "1.6.1"
150+
digits_iterator = "0.1.0"
151+
csv = "1.1.6"
152+
conv = "0.3.3"
153+
compare = "0.1.0"
154+
char-iter = "0.1.0"
155+
caseless = "0.2.1"
156+
binomial-iter = "0.1.0"
157+
bigint = "4.4.3"
158+
bigdecimal = "0.3.0"
159+
async-std = "1.10.0"
160+
async-channel = "1.6.1"
161+
assert_float_eq = "1.1.3"
162+
array_tool = "1.0.3"
163+
z3 = "0.11.2"
164+
xvii = "0.4.1"
165+
workerpool = "1.2.0"
166+
unidecode = "0.3.0"
167+
unicode-case-mapping = "0.2.0"
168+
unic-langid = "0.9.0"
169+
tramp = "0.3.0"
170+
tinyset = "0.4.6"
171+
stringreader = "0.1.1"
172+
static_assertions = "1.1.0"
173+
spinning_top = "0.2.4"
174+
sparse-bitfield = "0.11.0"
175+
sliding_windows = "3.0.0"
176+
simplelog = "0.11.0"
177+
simple_parallel = "0.3.0"
178+
serial_test = "0.5.1"
179+
scoped_threadpool = "0.1.9"
180+
scoped-pool = "1.0.0"
181+
rustc-hash = "1.1.0"
182+
rug = "1.14.0"
183+
reduce = "0.1.4"
184+
queues = "1.1.0"
185+
pprof = "0.6.1"
186+
phf_macros = "0.10.0"
187+
pathfinding = "2.2.2"
188+
out = "6.1.0"
189+
numtoa = "0.2.4"
190+
num-format = "0.4.0"
191+
num-digitize = "0.4.2"
192+
mustache = "0.9.0"
193+
memoize = "0.1.9"
194+
macro-attr = "0.2.0"
195+
log = "0.4.14"
196+
lexical-sort = "0.3.1"
197+
left-pad = "1.0.1"
198+
lalrpop-util = "0.19.6"
199+
itoa = "0.4.8"
200+
indoc = "1.0.3"
201+
incremental-topo = "0.1.2"
202+
humantime = "2.1.0"
203+
hashbrown = "0.11.2"
204+
genawaiter = "0.99.1"
205+
futures-core = "0.3.18"
206+
free-ranges = "1.0.7"
207+
foreach = "0.3.0"
208+
fluent = "0.16.0"
209+
flamer = "0.4.0"
210+
flame = "0.2.2"
211+
flagset = "0.4.2"
212+
fixedbitset = "0.4.0"
213+
fasteval = "0.2.4"
214+
fancy-regex = "0.7.1"
215+
failure_derive = "0.1.8"
216+
enumset = "1.0.8"
217+
enum-utils = "0.1.2"
218+
encode_unicode = "0.3.6"
219+
easybench = "1.1.0"
220+
divisors = "0.2.1"
221+
dia-time = "6.1.0"
222+
deunicode = "1.3.1"
223+
defaultmap = "0.5.0"
224+
cranelift-simplejit = "0.68.0"
225+
cranelift-module = "0.78.0"
226+
cranelift = "0.78.0"
227+
cow-utils = "0.1.2"
228+
convert_case = "0.4.0"
229+
const_fn_assert = "0.1.2"
230+
clap = "3.0.0-beta.5"
231+
chomp = "0.3.1"
232+
chashmap = "2.2.2"
233+
change-case = "0.2.0"
234+
cast = "0.3.0"
235+
case_insensitive_hashmap = "1.0.0"
236+
bstr = "0.2.17"
237+
binary-heap-plus = "0.4.1"
238+
as-slice = "0.2.1"
239+
arr_macro = "0.1.3"
240+
alloc_counter = "0.0.4"

0 commit comments

Comments
 (0)