diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..ec90c4e --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,20 @@ +name: Test Contracts +on: + push: + pull_request: +jobs: + check: + runs-on: ubuntu-latest + steps: + - 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: ../../Scarb.lock + + - name: Run tests + run: scarb build && scarb run test \ No newline at end of file diff --git a/.tool-versions b/.tool-versions new file mode 100644 index 0000000..db6183a --- /dev/null +++ b/.tool-versions @@ -0,0 +1 @@ +starknet-foundry 0.48.1 \ No newline at end of file diff --git a/README.md b/README.md index 55ba66e..f46b457 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,34 @@ # Cairo Bootcamp 5.0 This repository contains all the codes for Cairo Bootcamp 5.0 + +## Set up instructions +To set up this repository, you will need to install [Starkup](https://github.com/software-mansion/starkup). + +StarkUp installs and setup the following packages in your machine: +- Scarb - the Cairo package manager +- Starknet Foundry - the Cairo and Starknet testing framework +- Universal Sierra Compiler - compiler for any ever-existing Sierra version +- Cairo Profiler - profiler for Cairo programming language & Starknet +- Cairo Coverage - utility for coverage reports generation for code written in Cairo programming language +- CairoLS - vscode extension + + +Run the following command to install StarkUp: +```bash +curl --proto '=https' --tlsv1.2 -sSf https://sh.starkup.sh | sh +``` + +## Build and Test Contracts +To build and test the contracts, run the following commands + +**Build contracts** +```bash +scarb build +``` + +**Run contract tests** +```bash +scarb run test +``` + +> `scarb run test` runs `snforge test` under the hood. So you can optionally use `snforge test` to test the contracts \ No newline at end of file