Skip to content

Commit f608e8b

Browse files
committed
Fix liquid linting errors
1 parent 9137ccf commit f608e8b

File tree

1 file changed

+10
-14
lines changed

1 file changed

+10
-14
lines changed

Diff for: content/actions/use-cases-and-examples/building-and-testing/building-and-testing-rust.md

+10-14
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ We recommend that you have a basic understanding of the Rust language. For more
4646

4747
## Specifying a Rust version
4848

49-
At the time of writing, the default rust compiler version is 1.83.0 rustup is available and can be used to install additional toolchains. For example, the following workflow temporarily sets the toolchain to nightly:
49+
At the time of writing, the default rust compiler version is 1.83.0 rustup is available and can be used to install additional toolchains.
5050

5151
```yaml copy
5252
- name: Temporarily modify the rust toolchain version
@@ -61,21 +61,21 @@ You can cache and restore dependencies using the following example below. Note t
6161
6262
```yaml copy
6363
- name: ⚡ Cache
64-
uses: actions/cache@v4
64+
- uses: {% data reusables.actions.action-cache %}
6565
with:
6666
path: |
6767
~/.cargo/registry
6868
~/.cargo/git
6969
target
70-
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
70+
key: {% raw %}${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}{% endraw %}
7171
```
72+
7273
If you have a custom requirement or need finer controls for caching, you can take a look at the [`cache` action](https://github.com/marketplace/actions/cache). For more information, see [AUTOTITLE](/actions/using-workflows/caching-dependencies-to-speed-up-workflows).
7374

7475
## Building and testing your code
7576

7677
You can use the same commands that you use locally to build and test your code. This example workflow demonstrates how to use `cargo build` and `cargo test` in a job:
7778

78-
7979
```yaml copy
8080
jobs:
8181
build:
@@ -86,36 +86,32 @@ jobs:
8686
outputs:
8787
release_built: ${{ steps.set-output.outputs.release_built }}
8888
steps:
89-
- uses: actions/checkout@v4
89+
- uses: {% data reusables.actions.action-checkout %}
9090
- name: Build binaries in "${{ matrix.BUILD_TARGET }}" mode
9191
run: cargo build --profile ${{ matrix.BUILD_TARGET }}
9292
- name: Run tests in "${{ matrix.BUILD_TARGET }}" mode
9393
run: cargo test --profile ${{ matrix.BUILD_TARGET }}
9494
```
95+
9596
Note that the `release` keyword used above, corresponds to a cargo profile. You can use any [profile](https://doc.rust-lang.org/cargo/reference/profiles.html) you have defined in your `Cargo.toml` file.
9697

9798
## Upload artifacts
9899

99100
In case publishing artifacts is needed, but not to crates.io, the following example demonstrates how to upload artifacts to the workflow run:
101+
100102
```yaml copy
101-
- name: Upload Telegram Bot
102-
uses: actions/upload-artifact@v4
103-
with:
104-
name: cndk8-telegram-bot
105-
path: target/${{ matrix.BUILD_TARGET }}/telegram
106103
- name: Upload hello app
107-
uses: actions/upload-artifact@v4
104+
uses: {% data reusables.actions.action-upload-artifact %}
108105
with:
109106
name: cndk8-hello
110107
path: target/${{ matrix.BUILD_TARGET }}/cndk8
111108
```
112109

113110
And to use them on a different job, i.e publishing:
114111

115-
116112
```yaml copy
117113
- name: Download hello app
118-
uses: actions/download-artifact@v4
114+
uses: {% data reusables.actions.action-download-artifact %}
119115
with:
120116
name: cndk8-hello
121117
path: ./cndk8-hello
@@ -132,7 +128,6 @@ And to use them on a different job, i.e publishing:
132128
Once you have setup your workflow to build and test your code, you can alternatively use a secret to login to crates.io and publish your package.
133129

134130
```yaml copy
135-
- uses: actions/checkout@v4
136131
- name: login into crates.io
137132
run: cargo login ${{ secrets.CRATES_IO }}
138133
- name: Build binaries in "release" mode
@@ -142,5 +137,6 @@ Once you have setup your workflow to build and test your code, you can alternati
142137
- name: "Publish to crates.io"
143138
run: cargo publish # publishes your crate as a library that can be added as a dependency
144139
```
140+
145141
As an example of how packages are published, see the [cndk8 0.1.0](https://crates.io/crates/cndk8/0.1.0). In the case that there are errors with Metadata check
146142
your [manifest](https://doc.rust-lang.org/cargo/reference/manifest.html) Cargo.toml, when its about dirty directory check your Cargo.lock, and read the corresponding documentation.

0 commit comments

Comments
 (0)