Skip to content
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
85 changes: 33 additions & 52 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,65 +18,46 @@ permissions:

jobs:
Test:
runs-on: ["8-cpu","self-hosted","org"]
runs-on: ["op-stack", "self-hosted", "org"]
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4
- uses: ./.github/workflows/composite/setup

- uses: actions/setup-go@v5
with:
go-version: '1.22'
- name: Test
run: make test

- name: Build
run: make all

- name: Test
run: make test

- uses: actions/setup-node@v4
with:
node-version: 18

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

- name: Run e2e tests local
shell: bash
run: e2e_test/run_all_tests.sh
- name: Run e2e tests local
shell: bash
run: e2e_test/run_all_tests.sh

Lint:
runs-on: ["8-cpu","self-hosted","org"]
runs-on: ["op-stack", "self-hosted", "org"]
steps:
- uses: actions/checkout@v4

- uses: actions/setup-go@v5
with:
go-version: '1.22'
cache: false

- name: Lint
run: make lint
- uses: actions/checkout@v4
- uses: ./.github/workflows/composite/setup
with:
build: false
setup-node-e2e: false
- name: Lint
run: make lint

Generate:
runs-on: ["ubuntu-latest"]
steps:
- uses: actions/checkout@v4

- uses: actions/setup-go@v5
with:
go-version: '1.22'
cache: false

- name: Generate check
# Run go generate and see if anything changed.
# We need to use || true because currently we do not install protoc
# and protoc-gen-go which are required for generating some files,
# however despite this the non protobuf related types are generated.
run: |
go generate ./... || true
if [ -n "$(git status --porcelain)" ]; then
echo "Changes detected after running 'go generate ./...' run generate locally and commit the changes."
exit 1
fi
shell: sh
- uses: actions/checkout@v4
- uses: ./.github/workflows/composite/setup
with:
build: false
setup-node-e2e: false
- name: Generate check
# Run go generate and see if anything changed.
# We need to use || true because currently we do not install protoc
# and protoc-gen-go which are required for generating some files,
# however despite this the non protobuf related types are generated.
run: |
go generate ./... || true
if [ -n "$(git status --porcelain)" ]; then
echo "Changes detected after running 'go generate ./...' run generate locally and commit the changes."
exit 1
fi
shell: sh
32 changes: 32 additions & 0 deletions .github/workflows/composite/setup/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: "Setup dependencies & build"
description: "Checkout, setup dependencies and build go binaries"
inputs:
build:
description: "Build"
default: true
setup-node-e2e:
description: "Setup node for e2e tests"
default: true
setup-foundry:
description: "Setup foundry"
default: true
runs:
using: "composite"
steps:
- uses: actions/setup-go@v5
with:
go-version: "1.22"
cache: false
- uses: actions/setup-node@v4
if: "${{ inputs.setup-node-e2e == 'true' }}"
with:
node-version-file: "e2e_test/js-tests/package.json"
- name: Install Foundry
if: "${{ inputs.setup-foundry == 'true' }}"
uses: foundry-rs/foundry-toolchain@v1.4.0
with:
version: v1.1.0
- name: Build
if: "${{ inputs.build == 'true' }}"
shell: bash
run: make all
20 changes: 2 additions & 18 deletions .github/workflows/e2e-test-deployed-network.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,26 +17,10 @@ permissions:

jobs:
e2e-tests:
runs-on: ["8-cpu","self-hosted","org"]
runs-on: ["op-stack","self-hosted","org"]
steps:
- uses: actions/checkout@v4

- uses: actions/setup-go@v5
with:
go-version: '1.21'

- name: Build
run: make all

- uses: actions/setup-node@v4
with:
node-version: 18

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

- uses: ./.github/workflows/composite/setup
- name: Run e2e tests alfajores
shell: bash
run: NETWORK=alfajores e2e_test/run_all_tests.sh
6 changes: 3 additions & 3 deletions e2e_test/debug-fee-currency/lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ function deploy_fee_currency() {
(
DEFAULT_INTRINSIC_GAS=60000
local fee_currency=$(
forge create --json --root "$SCRIPT_DIR/debug-fee-currency" --contracts "$SCRIPT_DIR/debug-fee-currency" --private-key $ACC_PRIVKEY DebugFeeCurrency.sol:DebugFeeCurrency --constructor-args '100000000000000000000000000' $1 $2 $3 | jq .deployedTo -r
forge create --broadcast --json --root "$SCRIPT_DIR/debug-fee-currency" --contracts "$SCRIPT_DIR/debug-fee-currency" --private-key $ACC_PRIVKEY DebugFeeCurrency.sol:DebugFeeCurrency --constructor-args '100000000000000000000000000' $1 $2 $3 | jq .deployedTo -r
)
if [ -z "${fee_currency}" ]; then
exit 1
fi
# this always resets the token address for the predeployed oracle3
cast send --private-key $ACC_PRIVKEY $ORACLE3 'setExchangeRate(address, uint256, uint256)' $fee_currency 2ether 1ether > /dev/null
cast send --private-key $ACC_PRIVKEY $FEE_CURRENCY_DIRECTORY_ADDR 'setCurrencyConfig(address, address, uint256)' $fee_currency $ORACLE3 ${4:-$DEFAULT_INTRINSIC_GAS} > /dev/null
cast send --private-key $ACC_PRIVKEY $ORACLE3 'setExchangeRate(address, uint256, uint256)' $fee_currency 2ether 1ether >/dev/null
cast send --private-key $ACC_PRIVKEY $FEE_CURRENCY_DIRECTORY_ADDR 'setCurrencyConfig(address, address, uint256)' $fee_currency $ORACLE3 ${4:-$DEFAULT_INTRINSIC_GAS} >/dev/null
echo "$fee_currency"
)
}
Expand Down
Loading