Skip to content

Commit a0c320f

Browse files
Merge #951
951: remove actions-rs r=Alexhuszagh,reitermarkus a=Emilgardis This essentially removes all actions-rs actions and replaces it with what is needed. Reason for this is due to actions-rs being seemingly unmaintained Co-authored-by: Emil Gardström <emil.gardstrom@gmail.com>
2 parents c1f9e8a + 1ecaf33 commit a0c320f

File tree

6 files changed

+57
-40
lines changed

6 files changed

+57
-40
lines changed

.github/actions/cargo-install-upload-artifacts/action.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,15 @@ runs:
2929
shell: bash
3030

3131
- name: Build with all features
32-
uses: actions-rs/cargo@v1
33-
with:
34-
command: install
35-
args: >
32+
run:
33+
cargo install
3634
--locked
3735
--path .
3836
--target ${{ inputs.target }}
3937
--all-features
4038
--root ${{ steps.metadata.outputs.out-dir }}
4139
--bins
42-
use-cross: true
40+
shell: ${{ contains(runner.os, 'windows') && 'pwsh' || 'bash' }}
4341
env:
4442
RUSTFLAGS: "" # Make sure to unset RUSTFLAGS
4543

.github/actions/cargo-publish/action.yml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,8 @@ runs:
2828

2929
- name: Log into crates.io
3030
if: github.event_name != 'pull_request'
31-
uses: actions-rs/cargo@v1
32-
with:
33-
command: login
34-
args: -- ${{ inputs.cargo-registry-token }}
31+
run: cargo login -- ${{ inputs.cargo-registry-token }}
32+
shell: bash
3533

3634
- run: gh release delete --yes Unreleased || exit 0
3735
if: >
@@ -57,7 +55,5 @@ runs:
5755
${{ steps.download-artifacts.outputs.download-path }}/cross-*/*
5856
5957
- name: Publish crate
60-
uses: actions-rs/cargo@v1
61-
with:
62-
command: publish
63-
args: ${{ !startsWith(github.ref, 'refs/tags/v') && '--dry-run' || '' }}
58+
run: cargo publish ${{ !startsWith(github.ref, 'refs/tags/v') && '--dry-run' || '' }}
59+
shell: bash

.github/actions/setup-rust/action.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,15 @@ inputs:
1515
runs:
1616
using: composite
1717
steps:
18-
# Work around for sporadic issues with rustup self-update on windows
19-
- run: rustup set auto-self-update disable
20-
if: contains(runner.os, 'windows')
21-
shell: bash
2218
- name: Install Rust toolchain
23-
uses: actions-rs/toolchain@v1
19+
uses: dtolnay/rust-toolchain@v1
2420
with:
2521
toolchain: ${{ inputs.toolchain }}
2622
target: ${{ inputs.target }}
27-
default: true
2823
components: ${{ inputs.components }}
29-
profile: minimal
24+
25+
- name: Install rust matcher
26+
run: echo "::add-matcher::.github/actions/setup-rust/rust.json"
27+
shell: bash
3028

3129
- uses: Swatinem/rust-cache@v1.3.0

.github/actions/setup-rust/rust.json

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"problemMatcher": [
3+
{
4+
"owner": "rust",
5+
"pattern": [
6+
{
7+
"regexp": "^(warning|warn|error)(\\[(.*)\\])?: (.*)$",
8+
"severity": 1,
9+
"message": 4,
10+
"code": 3
11+
},
12+
{
13+
"regexp": "^([\\s->=]*(.*):(\\d*):(\\d*)|.*)$",
14+
"file": 2,
15+
"line": 3,
16+
"column": 4
17+
}
18+
]
19+
},
20+
{
21+
"owner": "cross-rs",
22+
"pattern": [
23+
{
24+
"regexp": "^\\[cross\\] (warning|error): (.*)$",
25+
"severity": 1,
26+
"message": 2
27+
}
28+
]
29+
}
30+
]
31+
}

.github/workflows/ci.yml

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,7 @@ jobs:
3636
components: rustfmt
3737

3838
- name: Run rustfmt
39-
uses: actions-rs/cargo@v1
40-
with:
41-
command: fmt
42-
args: -- --check
39+
run: cargo fmt -- --check
4340

4441
clippy:
4542
runs-on: ${{ matrix.os }}
@@ -58,11 +55,7 @@ jobs:
5855
toolchain: 1.58.1 # MSRV, Minimally Supported Rust Version. Make sure to update README.md
5956

6057
- name: Run clippy
61-
uses: actions-rs/cargo@v1
62-
with:
63-
command: clippy
64-
args: --locked --all-targets --all-features --workspace -- -D warnings
65-
58+
run: cargo clippy --locked --all-targets --all-features --workspace -- -D warnings
6659
test:
6760
runs-on: ${{ matrix.os }}
6861
strategy:
@@ -80,10 +73,7 @@ jobs:
8073
name: test-${{matrix.os}}
8174

8275
- name: Run unit tests
83-
uses: actions-rs/cargo@v1
84-
with:
85-
command: test
86-
args: --locked --all-targets --workspace --all-features
76+
run: cargo test --locked --all-targets --workspace --all-features
8777
timeout-minutes: 10
8878
check:
8979
runs-on: ubuntu-latest
@@ -94,7 +84,6 @@ jobs:
9484
- uses: ./.github/actions/setup-rust
9585
- run: cargo xtask ci-job check
9686
id: check
97-
shell: bash
9887
generate-matrix:
9988
runs-on: ubuntu-latest
10089
outputs:
@@ -199,7 +188,6 @@ jobs:
199188
if: matrix.deploy
200189
with:
201190
target: ${{ matrix.target }}
202-
image: ${{ steps.build-docker-image.outputs.image }}
203191

204192
- name: Test Zig Image
205193
if: steps.prepare-meta.outputs.has-image && steps.prepare-meta.outputs.test-variant == 'zig'

src/lib.rs

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -756,15 +756,21 @@ pub(crate) fn warn_host_version_mismatch(
756756
host_version_meta.short_version_string
757757
);
758758
if versions.is_lt() || (versions.is_eq() && dates.is_lt()) {
759-
msg_info.warn(format_args!("using older {rustc_warning}.\n > Update with `rustup update --force-non-host {toolchain}`"))?;
759+
if cfg!(not(test)) {
760+
msg_info.warn(format_args!("using older {rustc_warning}.\n > Update with `rustup update --force-non-host {toolchain}`"))?;
761+
}
760762
return Ok(VersionMatch::OlderTarget);
761763
} else if versions.is_gt() || (versions.is_eq() && dates.is_gt()) {
762-
msg_info.warn(format_args!(
763-
"using newer {rustc_warning}.\n > Update with `rustup update`"
764-
))?;
764+
if cfg!(not(test)) {
765+
msg_info.warn(format_args!(
766+
"using newer {rustc_warning}.\n > Update with `rustup update`"
767+
))?;
768+
}
765769
return Ok(VersionMatch::NewerTarget);
766770
} else {
767-
msg_info.warn(format_args!("using {rustc_warning}."))?;
771+
if cfg!(not(test)) {
772+
msg_info.warn(format_args!("using {rustc_warning}."))?;
773+
}
768774
return Ok(VersionMatch::Different);
769775
}
770776
}

0 commit comments

Comments
 (0)