Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add caching example #24

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 19 additions & 3 deletions README.md
franciszekjob marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd include an link to setup-scarb page as well.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,13 @@

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

> 📝 **Note**
> At this moment, only Linux and MacOS are supported.

## Example workflow

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.

```yaml
name: My workflow
on:
Expand All @@ -13,9 +18,18 @@ jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: foundry-rs/setup-snfoundry@v3
- run: snforge
- uses: actions/checkout@v4

- name: Setup Starknet Foundry
uses: foundry-rs/setup-snfoundry@v3

- name: Setup Scarb
uses: software-mansion/setup-scarb@v1
with:
scarb-lock: ./hello_starknet/Scarb.lock

- name: Run tests
run: cd hello_starknet && snforge test
```

## Inputs
Expand All @@ -35,4 +49,6 @@ jobs:
subdirectory (`${{ steps.setup-starknet-foundry.outputs.starknet-foundry-prefix }}/bin`).
- `starknet-foundry-version` - Version of Starknet Foundry that was installed (as reported by `snforge -V`).

For more information, visit [Starknet Foundry docs section](https://foundry-rs.github.io/starknet-foundry/appendix/starknet-foundry-github-action.html) dedicated to CI setup.

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