Skip to content

Commit

Permalink
setup scarb action
Browse files Browse the repository at this point in the history
  • Loading branch information
moodysalem committed Aug 3, 2023
1 parent b90492c commit 99bc484
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 19 deletions.
20 changes: 2 additions & 18 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,31 +8,15 @@ on:
branches:
- main

env:
SCARB_VERSION: v0.6.0-alpha.2

jobs:
main:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Cache Scarb binary
uses: actions/cache@v3
with:
path: ~/.scarb
key: scarb-${{ env.SCARB_VERSION }}-${{ runner.os }}
restore-keys: scarb-${{ env.SCARB_VERSION }}-${{ runner.os }}

- name: Scarb Setup
run: |
if [[ ! -f $HOME/.scarb/bin/scarb ]]; then
wget https://github.com/software-mansion/scarb/releases/download/${{ env.SCARB_VERSION }}/scarb-${{ env.SCARB_VERSION }}-x86_64-unknown-linux-gnu.tar.gz
mkdir $HOME/.scarb
tar -xvzf scarb-${{ env.SCARB_VERSION }}-x86_64-unknown-linux-gnu.tar.gz -C $HOME/.scarb --strip-components=1
fi
echo "$HOME/.scarb/bin" >> $GITHUB_PATH
- name: Setup Scarb
uses: software-mansion/setup-scarb@v1

- name: Test the code
run: |
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ The structure is as follows:

## Testing

This code uses the version of Scarb specified in [.github/workflows/test.yaml](./.github/workflows/test.yaml). To run unit tests, simply run:
Make sure you have [Scarb with asdf](https://docs.swmansion.com/scarb/download#install-via-asdf) installed.

To run unit tests:

```
scarb test
Expand Down

0 comments on commit 99bc484

Please sign in to comment.