File tree Expand file tree Collapse file tree 3 files changed +27
-8
lines changed Expand file tree Collapse file tree 3 files changed +27
-8
lines changed Original file line number Diff line number Diff line change 15
15
matrix :
16
16
rust : [
17
17
# Test with toolchain file override
18
- " 1.50" ,
18
+ " 1.60" ,
19
+ # Test that the sparse registry check works.
20
+ # 1.66 and 1.67 don't support stable sparse registry.
21
+ " 1.66" ,
19
22
" nightly" ,
20
23
" beta" ,
21
24
" stable" ,
@@ -27,13 +30,13 @@ jobs:
27
30
run : |
28
31
cat <<EOF >>rust-toolchain.toml
29
32
[toolchain]
30
- channel = "nightly-2020-07 -10"
33
+ channel = "nightly-2022-09 -10"
31
34
components = [ "rustfmt", "rustc-dev" ]
32
35
targets = [ "wasm32-unknown-unknown", "thumbv2-none-eabi" ]
33
36
profile = "minimal"
34
37
EOF
35
38
shell : bash
36
- if : matrix.rust == '1.50 '
39
+ if : matrix.rust == '1.60 '
37
40
38
41
- uses : ./
39
42
name : Run actions-rust-lang/setup-rust-toolchain ${{matrix.rust}}
48
51
run : echo '${{steps.toolchain.outputs.rustup-version}}'
49
52
- run : rustc --version && cargo --version
50
53
shell : bash
54
+
55
+ # Test with creating a small project
56
+ - run : cargo init . --bin --name ci
57
+ # Add tiny empty crate.
58
+ # This checks that registry access works.
59
+ - run : cargo add serde_as
60
+ - run : cargo check
Original file line number Diff line number Diff line change @@ -11,7 +11,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
11
11
12
12
* Only set environment variables, if they are not set before.
13
13
This allows setting environment variables before using this action and keeping their values.
14
-
14
+ * Enable stable sparse registry, except on versions 1.66 and 1.67 where this leads to errors.
15
+
15
16
## [ 1.3.7] - 2023-01-31
16
17
17
18
### Fixed
Original file line number Diff line number Diff line change 78
78
if [[ ! -v CARGO_UNSTABLE_SPARSE_REGISTRY ]]; then
79
79
echo "CARGO_UNSTABLE_SPARSE_REGISTRY=true" >> $GITHUB_ENV
80
80
fi
81
- # Enable sparse index after stabilization
82
- # This causes warnings on stable 1.67, e.g., when using "cargo add"
83
- # https://github.com/rust-lang/cargo/pull/11224
84
- # echo "CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse" >> $GITHUB_ENV
85
81
shell : bash
86
82
- name : " Install Rust Problem Matcher"
87
83
run : echo "::add-matcher::${{ github.action_path }}/rust.json"
@@ -123,6 +119,18 @@ runs:
123
119
echo "cachekey=$(echo $DATE$HASH | head -c12)" >> $GITHUB_OUTPUT
124
120
shell : bash
125
121
122
+ # Copied from dtolnay/rust-toolchain and adapted
123
+ # https://github.com/dtolnay/rust-toolchain/blob/25dc93b901a87e864900a8aec6c12e9aa794c0c3/action.yml#L100-L108
124
+ - name : " Enable cargo sparse registry on stable"
125
+ run : |
126
+ # except on 1.66 and 1.67, on which it is unstable
127
+ if [[ ! -v CARGO_REGISTRIES_CRATES_IO_PROTOCOL ]]; then
128
+ if echo "${{steps.versions.outputs.rustc-version}}" | not grep -q '^rustc 1\.6[67]\.'; then
129
+ echo "CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse" >> $GITHUB_ENV
130
+ fi
131
+ fi
132
+ shell : bash
133
+
126
134
- name : " Setup Rust Caching"
127
135
if : inputs.cache == 'true'
128
136
uses : Swatinem/rust-cache@v2
You can’t perform that action at this time.
0 commit comments