Merge pull request #138 from Olexandr88/patch-2 #24
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI Pipeline | |
on: | |
push: | |
branches: [main, dev] | |
pull_request: | |
branches: [main, dev] | |
jobs: | |
lint-test-build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: 1.20 | |
- name: Install dependencies | |
run: go mod tidy | |
- name: Run Linter | |
run: | | |
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest | |
golangci-lint run | |
- name: Run Tests | |
run: go test ./... | |
- name: Build Project | |
run: go build -v ./... | |
db-migration-validation: | |
runs-on: ubuntu-latest | |
needs: lint-test-build | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Validate DB Migrations | |
run: | | |
echo "Run your migration tool here, e.g., goose, migrate, or sqlc validate" | |
# Example if using golang-migrate: | |
# migrate -path db/migrations -database $DATABASE_URL up | |
smart-contract-validation: | |
runs-on: ubuntu-latest | |
needs: lint-test-build | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up dependencies (Node, Cairo, etc.) | |
run: | | |
sudo apt update | |
sudo apt install -y cairo-lang | |
cairo-compile --version | |
- name: Compile Smart Contracts | |
run: | | |
echo "Compiling StarkNet contracts" | |
cairo-compile path/to/contract.cairo --output path/to/output.json |