Skip to content

Commit

Permalink
Adds Justfile (#29)
Browse files Browse the repository at this point in the history
* Adds Justfile

* Adds an initial local dev setup script

* words

* Add github actions to install just and share the base setup between everything

* fix ordering

* fix indent
  • Loading branch information
nitaliano authored Jun 28, 2024
1 parent 6f5f3d3 commit 88124b9
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 17 deletions.
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

0 comments on commit 88124b9

Please sign in to comment.