Skip to content

Commit a5465a6

Browse files
committed
Added: More explicit tests and docs on selecting more concrete versions.
1 parent b939b5e commit a5465a6

File tree

3 files changed

+94
-25
lines changed

3 files changed

+94
-25
lines changed

.github/workflows/test-workflow.yml

Lines changed: 54 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,21 +75,69 @@ jobs:
7575
no-default-features: true
7676
codecov-token: ${{ secrets.CODECOV_TOKEN }}
7777

78-
test-nightly-beta-build:
79-
strategy:
80-
matrix:
81-
rust-toolchain: [nightly, beta]
78+
test-nightly:
8279
runs-on: ubuntu-latest
8380
steps:
8481
- name: Checkout Test Repository
8582
uses: actions/checkout@v4
8683
with:
8784
repository: Sewer56/prs-rs
8885
ref: 149060527e685360687d7332742ac016b39af8a7
89-
- name: Test Nightly/Beta Build
86+
- name: Test Nightly Build
9087
uses: Reloaded-Project/devops-rust-test-and-coverage@v1-test
9188
with:
92-
rust-toolchain: ${{ matrix.rust-toolchain }}
89+
rust-toolchain: nightly
90+
target: x86_64-unknown-linux-gnu
91+
features: 'c-exports,std'
92+
no-default-features: true
93+
codecov-token: ${{ secrets.CODECOV_TOKEN }}
94+
95+
test-beta:
96+
runs-on: ubuntu-latest
97+
steps:
98+
- name: Checkout Test Repository
99+
uses: actions/checkout@v4
100+
with:
101+
repository: Sewer56/prs-rs
102+
ref: 149060527e685360687d7332742ac016b39af8a7
103+
- name: Test Beta Build
104+
uses: Reloaded-Project/devops-rust-test-and-coverage@v1-test
105+
with:
106+
rust-toolchain: beta
107+
target: x86_64-unknown-linux-gnu
108+
features: 'c-exports,std'
109+
no-default-features: true
110+
codecov-token: ${{ secrets.CODECOV_TOKEN }}
111+
112+
test-specific-nightly:
113+
runs-on: ubuntu-latest
114+
steps:
115+
- name: Checkout Test Repository
116+
uses: actions/checkout@v4
117+
with:
118+
repository: Sewer56/prs-rs
119+
ref: 149060527e685360687d7332742ac016b39af8a7
120+
- name: Test Specific Nightly Release
121+
uses: Reloaded-Project/devops-rust-test-and-coverage@v1-test
122+
with:
123+
rust-toolchain: nightly-2025-09-18
124+
target: x86_64-unknown-linux-gnu
125+
features: 'c-exports,std'
126+
no-default-features: true
127+
codecov-token: ${{ secrets.CODECOV_TOKEN }}
128+
129+
test-specific-version:
130+
runs-on: ubuntu-latest
131+
steps:
132+
- name: Checkout Test Repository
133+
uses: actions/checkout@v4
134+
with:
135+
repository: Sewer56/prs-rs
136+
ref: 149060527e685360687d7332742ac016b39af8a7
137+
- name: Test Specific Version
138+
uses: Reloaded-Project/devops-rust-test-and-coverage@v1-test
139+
with:
140+
rust-toolchain: 1.90.0
93141
target: x86_64-unknown-linux-gnu
94142
features: 'c-exports,std'
95143
no-default-features: true

README.MD

Lines changed: 39 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -52,24 +52,24 @@ To use this action in your GitHub workflow, add the following step:
5252
5353
## Inputs
5454
55-
| Input | Description | Required | Default |
56-
| ------------------------ | ----------------------------------------------------------------------------- | -------- | -------------------- |
57-
| `rust-project-path` | Path to the Rust project | No | `'.'` |
58-
| `rust-toolchain` | Rust toolchain to use for building and testing (e.g., stable, nightly) | No | `'stable'` |
59-
| `target` | The target platform for the Rust compiler | No | `''` |
60-
| `install-rust-toolchain` | Whether to install the specified Rust toolchain | No | `true` |
61-
| `setup-rust-cache` | Whether to set up Rust caching | No | `true` |
62-
| `use-tarpaulin` | Whether to use Tarpaulin for code coverage. If false, only runs tests. | No | `true` |
63-
| `use-binstall` | Use `cargo-binstall` for installing tarpaulin. Else uses cargo install. | No | `true` |
64-
| `install-binstall` | Installs `cargo-binstall`. If false, assumes it is already available. | No | `true` |
65-
| `upload-coverage` | Whether to upload coverage to Codecov (only when using `cargo` and Tarpaulin) | No | `true` |
66-
| `codecov-token` | Codecov token for uploading coverage | No | N/A |
67-
| `codecov-flags` | Flags to pass to Codecov | No | `'unittests'` |
68-
| `codecov-name` | Custom defined name for the upload | No | `'codecov-umbrella'` |
69-
| `features` | Space-separated list of features to enable during testing | No | `''` |
70-
| `no-default-features` | Disable default features during testing | No | `false` |
71-
| `use-cross` | Use cross-rs for testing. If false, use cargo. | No | `false` |
72-
| `additional-test-args` | Additional arguments to pass to the cargo test command | No | `''` |
55+
| Input | Description | Required | Default |
56+
| ------------------------ | -------------------------------------------------------------------------------------------------- | -------- | -------------------- |
57+
| `rust-project-path` | Path to the Rust project | No | `'.'` |
58+
| `rust-toolchain` | Rust toolchain to use for building and testing (e.g., stable, nightly, 1.75.0, nightly-2024-02-08) | No | `'stable'` |
59+
| `target` | The target platform for the Rust compiler | No | `''` |
60+
| `install-rust-toolchain` | Whether to install the specified Rust toolchain | No | `true` |
61+
| `setup-rust-cache` | Whether to set up Rust caching | No | `true` |
62+
| `use-tarpaulin` | Whether to use Tarpaulin for code coverage. If false, only runs tests. | No | `true` |
63+
| `use-binstall` | Use `cargo-binstall` for installing tarpaulin. Else uses cargo install. | No | `true` |
64+
| `install-binstall` | Installs `cargo-binstall`. If false, assumes it is already available. | No | `true` |
65+
| `upload-coverage` | Whether to upload coverage to Codecov (only when using `cargo` and Tarpaulin) | No | `true` |
66+
| `codecov-token` | Codecov token for uploading coverage | No | N/A |
67+
| `codecov-flags` | Flags to pass to Codecov | No | `'unittests'` |
68+
| `codecov-name` | Custom defined name for the upload | No | `'codecov-umbrella'` |
69+
| `features` | Space-separated list of features to enable during testing | No | `''` |
70+
| `no-default-features` | Disable default features during testing | No | `false` |
71+
| `use-cross` | Use cross-rs for testing. If false, use cargo. | No | `false` |
72+
| `additional-test-args` | Additional arguments to pass to the cargo test command | No | `''` |
7373

7474
## Example Workflow
7575

@@ -174,6 +174,27 @@ This action is designed for Rust libraries without binary artifacts.
174174
If you're working on a project with binary artifacts, consider using [devops-rust-lightweight-binary][rust-lw-binary],
175175
instead, which will invoke this action as part of its workflow if tests are enabled.
176176

177+
### Rust Toolchain Examples
178+
179+
You can specify various Rust toolchain versions:
180+
181+
```yaml
182+
# Use stable channel
183+
rust-toolchain: 'stable'
184+
185+
# Use nightly channel
186+
rust-toolchain: 'nightly'
187+
188+
# Use specific version
189+
rust-toolchain: '1.75.0'
190+
191+
# Use specific nightly date
192+
rust-toolchain: 'nightly-2024-02-08'
193+
194+
# Use beta channel
195+
rust-toolchain: 'beta'
196+
```
197+
177198
## License
178199

179200
This GitHub Action is released under the [MIT License](LICENSE).

action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ inputs:
1010
required: false
1111
default: '.'
1212
rust-toolchain:
13-
description: 'Rust toolchain to use for building and testing (e.g., stable, nightly)'
13+
description: 'Rust toolchain to use for building and testing (e.g., stable, nightly, 1.75.0, nightly-2024-02-08)'
1414
required: false
1515
default: 'stable'
1616
target:

0 commit comments

Comments
 (0)