Skip to content

Commit 70af0d8

Browse files
Merge pull request #649 from kristof-mattei/update-from-upstream
update from upstream
2 parents 1516e88 + 44360d4 commit 70af0d8

File tree

8 files changed

+125
-144
lines changed

8 files changed

+125
-144
lines changed

.github/workflows/build.yml

Lines changed: 46 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -96,35 +96,43 @@ jobs:
9696
working-directory: /tmp
9797
run: |
9898
archive="cargo-binstall-x86_64-unknown-linux-musl.tgz"
99-
wget "https://github.com/cargo-bins/cargo-binstall/releases/latest/download/${archive}"
100-
101-
tar -xvf "./${archive}"
102-
103-
rm "./${archive}"
104-
105-
mv ./cargo-binstall ~/.cargo/bin/
99+
wget \
100+
--output-document=- \
101+
--timeout=10 \
102+
--waitretry=3 \
103+
--retry-connrefused \
104+
--progress=dot:mega \
105+
"https://github.com/cargo-bins/cargo-binstall/releases/latest/download/${archive}" \
106+
| tar \
107+
--directory=${HOME}/.cargo/bin/ \
108+
--strip-components=0 \
109+
--no-overwrite-dir \
110+
--extract \
111+
--verbose \
112+
--gunzip \
113+
--file=-
106114
107115
- name: Install cocogitto to get the next version number
108116
shell: bash
109117
run: |
110-
cargo binstall --no-confirm cocogitto --target x86_64-unknown-linux-musl --pkg-url "{ repo }/releases/download/{ version }/{ name }-{ version }-{ target }.tar.gz" --bin-dir "{ bin }" --pkg-fmt tgz
118+
cargo binstall --no-confirm cocogitto
111119
112120
- name: Calculate next version
113121
shell: bash
114122
id: version
115123
run: |
116-
VERSION="$(cog bump --auto --dry-run || true)"
124+
version="$(cog bump --auto --dry-run || true)"
117125
118-
if [[ "$VERSION" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
119-
echo "New version: ${VERSION}"
126+
if [[ "${version}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
127+
echo "New version: ${version}"
120128
else
121-
VERSION="v$(cog -v get-version)"
129+
version="v$(cog -v get-version)"
122130
123-
echo "No version generated, defaulting to latest tag: ${VERSION}"
131+
echo "No version generated, defaulting to latest tag: ${version}"
124132
fi
125133
126134
# remove v
127-
VERSION="${VERSION//v/}"
135+
version="${version//v/}"
128136
129137
# store
130138
echo "version=${VERSION}" >> ${GITHUB_OUTPUT}
@@ -331,36 +339,41 @@ jobs:
331339
working-directory: /tmp
332340
run: |
333341
archive="cargo-binstall-x86_64-unknown-linux-musl.tgz"
334-
wget "https://github.com/cargo-bins/cargo-binstall/releases/latest/download/${archive}"
335-
336-
tar -xvf "./${archive}"
337-
338-
rm "./${archive}"
339-
340-
mv ./cargo-binstall ~/.cargo/bin/
341-
342-
- name: Install nextest, custom test runner, with native support for junit
342+
wget \
343+
--output-document=- \
344+
--timeout=10 \
345+
--waitretry=3 \
346+
--retry-connrefused \
347+
--progress=dot:mega \
348+
"https://github.com/cargo-bins/cargo-binstall/releases/latest/download/${archive}" \
349+
| tar \
350+
--directory=${HOME}/.cargo/bin/ \
351+
--strip-components=0 \
352+
--no-overwrite-dir \
353+
--extract \
354+
--verbose \
355+
--gunzip \
356+
--file=-
357+
358+
- name: Install nextest, custom test runner, with native support for junit and grcov
343359
shell: bash
344360
run: |
345-
cargo binstall --no-confirm cargo-nextest;
346-
347-
- name: Install grcov
348-
shell: bash
349-
run: |
350-
cargo binstall --no-confirm grcov --pkg-url "{ repo }/releases/download/v{ version }/{ name }-{ target }.tar.bz2" --pkg-fmt tbz2 --bin-dir "{ bin }";
361+
cargo binstall --no-confirm cargo-nextest grcov
351362
352363
- name: Build with instrumentation support
353364
shell: bash
354365
env:
355-
RUSTFLAGS: "${{ env.RUSTFLAGS }} --allow=warnings -C instrument-coverage"
366+
RUSTFLAGS: "${{ env.RUSTFLAGS }} --allow=warnings -Cinstrument-coverage"
367+
# build-* ones are not parsed by grcov
368+
LLVM_PROFILE_FILE: "profiling/build-%p-%m.profraw"
356369
run: |
357370
cargo build --all-targets --all-features --workspace --verbose
358371
359372
- name: Run nextest
360373
shell: bash
361374
id: tests
362375
env:
363-
RUSTFLAGS: "${{ env.RUSTFLAGS }} --allow=warnings -C instrument-coverage"
376+
RUSTFLAGS: "${{ env.RUSTFLAGS }} --allow=warnings -Cinstrument-coverage"
364377
LLVM_PROFILE_FILE: "profiling/profile-%p-%m.profraw"
365378
run: |
366379
cargo nextest run --profile ci --no-fail-fast --all-targets --all-features --workspace
@@ -376,7 +389,7 @@ jobs:
376389
- name: Run grcov
377390
shell: bash
378391
run: |
379-
grcov $(find profiling -name "profile-*.profraw" -print) --source-dir . --binary-path ./target/debug/ --output-type lcov --branch --ignore-not-existing --llvm --keep-only "src/**" --keep-only "tests/**" --output-path ./reports/lcov.info
392+
grcov $(find . -name "profile-*.profraw" -print) --source-dir . --binary-path ./target/debug/ --output-type lcov --branch --ignore-not-existing --llvm --keep-only "src/**" --output-path ./reports/lcov.info
380393
381394
- name: Upload coverage results (to Codecov.io)
382395
uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # v5.4.3
@@ -405,7 +418,7 @@ jobs:
405418
# we don't know which subsection it belongs in GitHub
406419
# so we explicitly fail this one
407420
# which will fail All Done
408-
exit 1;
421+
exit 1
409422
410423
cargo-clippy-and-report:
411424
name: Cargo clippy (and report)

.github/workflows/lint-commits.yml

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,18 +55,26 @@ jobs:
5555
working-directory: /tmp
5656
run: |
5757
archive="cargo-binstall-x86_64-unknown-linux-musl.tgz"
58-
wget "https://github.com/cargo-bins/cargo-binstall/releases/latest/download/${archive}"
59-
60-
tar -xvf "./${archive}"
61-
62-
rm "./${archive}"
63-
64-
mv ./cargo-binstall ~/.cargo/bin/
58+
wget \
59+
--output-document=- \
60+
--timeout=10 \
61+
--waitretry=3 \
62+
--retry-connrefused \
63+
--progress=dot:mega \
64+
"https://github.com/cargo-bins/cargo-binstall/releases/latest/download/${archive}" \
65+
| tar \
66+
--directory=${HOME}/.cargo/bin/ \
67+
--strip-components=0 \
68+
--no-overwrite-dir \
69+
--extract \
70+
--verbose \
71+
--gunzip \
72+
--file=-
6573
6674
- name: Install cocogitto to get the next version number
6775
shell: bash
6876
run: |
69-
cargo binstall --no-confirm cocogitto --target x86_64-unknown-linux-musl --pkg-url "{ repo }/releases/download/{ version }/{ name }-{ version }-{ target }.tar.gz" --bin-dir "{ bin }" --pkg-fmt tgz
77+
cargo binstall --no-confirm cocogitto
7078
7179
- name: Check the commits
7280
shell: bash

.github/workflows/publish-crate-after-release.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
name: Publish crate
22

3-
env: {}
4-
53
concurrency:
64
group: "${{ github.workflow }}"
75
cancel-in-progress: false # last one must win in case of multiple releases
@@ -14,6 +12,9 @@ on:
1412
permissions:
1513
contents: read
1614

15+
env:
16+
CARGO_TERM_COLOR: always
17+
1718
jobs:
1819
repo-has-crate:
1920
name: Repo publishes crate?
@@ -26,8 +27,8 @@ jobs:
2627
id: determine
2728
shell: bash
2829
run: |
29-
HAS_CRATE="${{ vars.HAS_CRATE }}"
30-
echo "has_crate=${HAS_CRATE:-false}" >> ${GITHUB_OUTPUT}
30+
has_crate="${{ vars.HAS_CRATE }}"
31+
echo "has_crate=${has_crate:-false}" >> ${GITHUB_OUTPUT}
3132
3233
publish-crate:
3334
name: Publish crate
@@ -81,12 +82,12 @@ jobs:
8182
shell: bash
8283
id: version
8384
run: |
84-
VERSION="${{ github.ref_name }}"
85+
version="${{ github.ref_name }}"
8586
# remove v
86-
VERSION="${VERSION//v/}"
87+
version="${version//v/}"
8788
8889
# store
89-
cargo set-version ${VERSION}
90+
cargo set-version ${version}
9091
9192
# debug
9293
cat Cargo.toml

.github/workflows/release.yml

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
name: Release
22

3-
env:
4-
# Use docker.io for Docker Hub if empty
5-
REGISTRY: ghcr.io
6-
# github.repository as <account>/<repo>
7-
IMAGE_NAME: ${{ github.repository }}
8-
93
concurrency:
104
group: "${{ github.workflow }}"
115
cancel-in-progress: true # only last step is important, which runs or doesn't
@@ -19,6 +13,13 @@ permissions:
1913
issues: write
2014
pull-requests: write
2115

16+
env:
17+
CARGO_TERM_COLOR: always
18+
# Use docker.io for Docker Hub if empty
19+
REGISTRY: ghcr.io
20+
# github.repository as <account>/<repo>
21+
IMAGE_NAME: ${{ github.repository }}
22+
2223
jobs:
2324
release:
2425
name: Release
@@ -71,18 +72,26 @@ jobs:
7172
working-directory: /tmp
7273
run: |
7374
archive="cargo-binstall-x86_64-unknown-linux-musl.tgz"
74-
wget "https://github.com/cargo-bins/cargo-binstall/releases/latest/download/${archive}"
75-
76-
tar -xvf "./${archive}"
77-
78-
rm "./${archive}"
79-
80-
mv ./cargo-binstall ~/.cargo/bin/
75+
wget \
76+
--output-document=- \
77+
--timeout=10 \
78+
--waitretry=3 \
79+
--retry-connrefused \
80+
--progress=dot:mega \
81+
"https://github.com/cargo-bins/cargo-binstall/releases/latest/download/${archive}" \
82+
| tar \
83+
--directory=${HOME}/.cargo/bin/ \
84+
--strip-components=0 \
85+
--no-overwrite-dir \
86+
--extract \
87+
--verbose \
88+
--gunzip \
89+
--file=-
8190
8291
- name: Install cocogitto to get the next version number
8392
shell: bash
8493
run: |
85-
cargo binstall --no-confirm cocogitto --target x86_64-unknown-linux-musl --pkg-url "{ repo }/releases/download/{ version }/{ name }-{ version }-{ target }.tar.gz" --bin-dir "{ bin }" --pkg-fmt tgz
94+
cargo binstall --no-confirm cocogitto
8695
8796
- name: Bump
8897
shell: bash
@@ -93,8 +102,8 @@ jobs:
93102
94103
cog bump --auto
95104
96-
VERSION="v$(cog -v get-version)"
97-
echo "version=$VERSION" >> $GITHUB_OUTPUT
105+
version="v$(cog -v get-version)"
106+
echo "version=$version" >> ${GITHUB_OUTPUT}
98107
99108
git push
100109

.github/workflows/test-release.yml

Lines changed: 27 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
name: Test Release
22

3-
env:
4-
# Use docker.io for Docker Hub if empty
5-
REGISTRY: ghcr.io
6-
# github.repository as <account>/<repo>
7-
IMAGE_NAME: ${{ github.repository }}
8-
93
on:
104
workflow_dispatch: # releasing is manual as we don't want to release every time
115

@@ -14,6 +8,13 @@ permissions:
148
issues: read
159
pull-requests: read
1610

11+
env:
12+
CARGO_TERM_COLOR: always
13+
# Use docker.io for Docker Hub if empty
14+
REGISTRY: ghcr.io
15+
# github.repository as <account>/<repo>
16+
IMAGE_NAME: ${{ github.repository }}
17+
1718
jobs:
1819
test-release:
1920
name: Test Release
@@ -65,18 +66,26 @@ jobs:
6566
working-directory: /tmp
6667
run: |
6768
archive="cargo-binstall-x86_64-unknown-linux-musl.tgz"
68-
wget "https://github.com/cargo-bins/cargo-binstall/releases/latest/download/${archive}"
69-
70-
tar -xvf "./${archive}"
71-
72-
rm "./${archive}"
73-
74-
mv ./cargo-binstall ~/.cargo/bin/
69+
wget \
70+
--output-document=- \
71+
--timeout=10 \
72+
--waitretry=3 \
73+
--retry-connrefused \
74+
--progress=dot:mega \
75+
"https://github.com/cargo-bins/cargo-binstall/releases/latest/download/${archive}" \
76+
| tar \
77+
--directory=${HOME}/.cargo/bin/ \
78+
--strip-components=0 \
79+
--no-overwrite-dir \
80+
--extract \
81+
--verbose \
82+
--gunzip \
83+
--file=-
7584
7685
- name: Install cocogitto to get the next version number
7786
shell: bash
7887
run: |
79-
cargo binstall --no-confirm cocogitto --target x86_64-unknown-linux-musl --pkg-url "{ repo }/releases/download/{ version }/{ name }-{ version }-{ target }.tar.gz" --bin-dir "{ bin }" --pkg-fmt tgz
88+
cargo binstall --no-confirm cocogitto
8089
8190
- name: Bump
8291
shell: bash
@@ -87,12 +96,12 @@ jobs:
8796
8897
cog bump --auto
8998
90-
VERSION="v$(cog -v get-version)"
91-
echo "version=$VERSION" >> $GITHUB_OUTPUT
99+
version="v$(cog -v get-version)"
100+
echo "version=${version}" >> ${GITHUB_OUTPUT}
92101
93-
cog changelog --at ${VERSION} > GITHUB_CHANGELOG.md
102+
cog changelog --at ${version} > GITHUB_CHANGELOG.md
94103
95-
echo "New version: ${VERSION}"
104+
echo "New version: ${version}"
96105
97106
echo "Changelog: "
98107

build.sh

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

0 commit comments

Comments
 (0)