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

Adds Justfile #29

Merged
merged 6 commits into from
Jun 28, 2024
Merged
Show file tree
Hide file tree
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
18 changes: 18 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Setup
runs:
using: composite
steps:
- name: Setup Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly

- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: '^1.22'

- name: Setup Just
uses: extractions/setup-just@v1
with:
just-version: 1.5.0
24 changes: 7 additions & 17 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,17 @@ jobs:
with:
submodules: recursive

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
- name: Setup
uses: ./.github/actions/setup

- name: Run Forge build
run: |
forge --version
forge build --sizes --root ./contracts
just build-contracts
id: build

- name: Run Forge tests
run: |
forge test -vvv --root ./contracts
just test-contracts
id: test

go-tests:
Expand All @@ -50,18 +47,11 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '^1.22'
- name: Setup
uses: ./.github/actions/setup

- name: Install dependencies
run: go mod download

- name: Run tests
run: go test ./... -v
run: just test-go
17 changes: 17 additions & 0 deletions Justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
set positional-arguments

build-contracts:
forge --version
forge build --sizes --root ./contracts

build-go:
go build ./...

test-contracts:
forge test -vvv --root ./contracts

test-go:
go test ./... -v

start:
go run ./...
22 changes: 22 additions & 0 deletions scripts/local-dev-setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env bash

##################
# Just Setup #
##################

echo "Checking just setup"

if ! command -v just > /dev/null 2>&1; then
# create ~/bin
mkdir -p ~/bin

# download and extract just to ~/bin/just
curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | bash -s -- --to ~/bin

# add `~/bin` to your path
export PATH="$PATH:$HOME/bin"

echo "just has been installed"
else
echo "skipping just install, it already exists."
fi
Loading