Skip to content

Feature/cd ci config #12

Feature/cd ci config

Feature/cd ci config #12

Workflow file for this run

name: CI
on:
pull_request:
push:
branches:
- main
schedule:
- cron: "0 0 * * *" # Run daily at midnight
jobs:
test-contracts:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Get latest Scarb version
id: scarb-version
run: |
snfoundry_version=$(curl -s https://api.github.com/repos/foundry-rs/starknet-foundry/releases/latest | grep tarball_url | awk -F '/' '{print $8}' | tr -d '",')
version=$(curl -s https://raw.githubusercontent.com/foundry-rs/starknet-foundry/$snfoundry_version/.tool-versions | awk '{print $2}')
echo "version=$version" >> "$GITHUB_OUTPUT"
- name: Setup Scarb
uses: software-mansion/setup-scarb@v1
with:
scarb-version: ${{ steps.scarb-version.outputs.version }}
- name: Setup Starknet Foundry
uses: foundry-rs/setup-snfoundry@v2
with:
version: latest
- name: Run tests
run: |
cd apps/snfoundry
snforge test
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Get latest Scarb version
id: scarb-version
run: |
snfoundry_version=$(curl -s https://api.github.com/repos/foundry-rs/starknet-foundry/releases/latest | grep tarball_url | awk -F '/' '{print $8}' | tr -d '",')
version=$(curl -s https://raw.githubusercontent.com/foundry-rs/starknet-foundry/$snfoundry_version/.tool-versions | awk '{print $2}')
echo "version=$version" >> "$GITHUB_OUTPUT"
- name: Setup Scarb
uses: software-mansion/setup-scarb@v1
with:
scarb-version: ${{ steps.scarb-version.outputs.version }}
- name: Check formatting
run: |
cd apps/snfoundry/contracts
scarb fmt --check