Skip to content

Commit fc873c0

Browse files
committed
Update example workflow
1 parent 0495832 commit fc873c0

File tree

1 file changed

+16
-31
lines changed

1 file changed

+16
-31
lines changed

README.md

Lines changed: 16 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,14 @@
22

33
Sets up [Starknet Foundry] in your GitHub Actions workflow supporting caching out of the box.
44

5+
6+
> 📝 **Note**
7+
> At this moment, only Linux and MacOS are supported.
8+
59
## Example workflow
610

11+
Make sure you pass the valid path to `Scarb.lock` to [setup-scarb](https://github.com/marketplace/actions/setup-scarb) action. This way, all dependencies including snforge_scarb_plugin will be cached between runs.
12+
713
```yaml
814
name: My workflow
915
on:
@@ -14,12 +20,17 @@ jobs:
1420
runs-on: ubuntu-latest
1521
steps:
1622
- uses: actions/checkout@v4
23+
1724
- name: Setup Starknet Foundry
1825
uses: foundry-rs/setup-snfoundry@v3
19-
- name: Check versions
20-
run: |
21-
snforge --version
22-
sncast --version
26+
27+
- name: Setup Scarb
28+
uses: software-mansion/setup-scarb@v1
29+
with:
30+
scarb-lock: ./hello_starknet/Scarb.lock
31+
32+
- name: Run tests
33+
run: cd hello_starknet && snforge test
2334
```
2435
2536
## Inputs
@@ -39,32 +50,6 @@ jobs:
3950
subdirectory (`${{ steps.setup-starknet-foundry.outputs.starknet-foundry-prefix }}/bin`).
4051
- `starknet-foundry-version` - Version of Starknet Foundry that was installed (as reported by `snforge -V`).
4152

42-
## Caching
43-
44-
In order to optimalize the workflow, you should cache the Starknet Foundry installation. Here is an example of how to do it:
45-
46-
```yaml
47-
name: My workflow
48-
on:
49-
push:
50-
pull_request:
51-
jobs:
52-
check:
53-
runs-on: ubuntu-latest
54-
steps:
55-
- uses: actions/checkout@v4
56-
- name: Setup Starknet Foundry
57-
id: setup-snfoundry
58-
uses: foundry-rs/setup-snfoundry@v3
59-
- name: Check versions
60-
run: |
61-
snforge --version
62-
sncast --version
63-
- name: Cache Starknet Foundry installation
64-
uses: actions/cache@v4
65-
with:
66-
path: ${{ steps.setup-snfoundry.outputs.starknet-foundry-prefix }}
67-
key: ${{ runner.os }}-snfoundry-${{ steps.setup-snfoundry.outputs.starknet-foundry-version }}
68-
```
53+
For more information, visit [Starknet Foundry docs section](https://foundry-rs.github.io/starknet-foundry/testing/running-tests.html) dedicated to CI setup.
6954

7055
[Starknet Foundry]: https://foundry-rs.github.io/starknet-foundry

0 commit comments

Comments
 (0)