Skip to content

Commit

Permalink
add e2e test ci step
Browse files Browse the repository at this point in the history
  • Loading branch information
nadim-az committed Oct 31, 2024
1 parent c321849 commit 0efffb2
Show file tree
Hide file tree
Showing 4 changed files with 94 additions and 8 deletions.
78 changes: 78 additions & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: e2e
on:
workflow_dispatch:
push:
branches: [main]
pull_request:
paths:
- '**.rs'
- '**.go'
- '**.toml'
- '**.lock'
- '**.mod'
- '**.sum'
- '**.sol'
- '.github/workflows/e2e.yml'
env:
FOUNDRY_PROFILE: ci
FOUNDRY_VERSION: nightly

permissions:
contents: read

jobs:
golangci:
name: test lint
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
with:
submodules: recursive

- uses: actions/setup-go@v4
with:
go-version: "1.22"
cache-dependency-path: tests/e2e/go.sum

- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.61
working-directory: tests/e2e
e2e:
strategy:
fail-fast: false
matrix:
test:
- TestWithSolverTestSuite/TestDeploy
name: ${{ matrix.test }}
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
with:
submodules: recursive

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: ${{ env.FOUNDRY_VERSION }}

- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: "1.22"
check-latest: true

- name: Install dependencies
run: |
forge install
go mod download
sudo apt-get update
sudo apt-get install -y build-essential
- name: Run E2E Tests
run: |
make tidy
make e2e-test
4 changes: 2 additions & 2 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ jobs:
uses: actions/setup-go@v3
with:
go-version: "1.21"
- name: Make tests
- name: Run unit tests
run: |
make tidy
make test
make unit-test
lint:
runs-on: ubuntu-latest
steps:
Expand Down
17 changes: 12 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,18 @@ run-solver:
###############################################################################
### Testing ###
###############################################################################
test:
go clean -testcache
go test --tags=test -v -race $(shell go list ./... | grep -v /scripts/)


.PHONY: unit-test
unit-test:
go test --tags=test -v -race $(shell go list ./... | grep -v /tests)

.PHONY: setup-foundry
setup-foundry:
cd tests/e2e && forge install foundry-rs/forge-std OpenZeppelin/openzeppelin-contracts OpenZeppelin/openzeppelin-contracts-upgradeable --no-commit

.PHONY: e2e-test
e2e-test: setup-foundry

cd tests/e2e && go test -v ./
###############################################################################
### Developer Tools ###
###############################################################################
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ make run-solver --config <configFilePath> --keys <keysFilePath> --key-store-type
### How to run tests

```shell
make test # run all tests
make unit-test
make e2e-test
```

### Database access
Expand Down

0 comments on commit 0efffb2

Please sign in to comment.