-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c9d09c9
commit a470b6e
Showing
7 changed files
with
197 additions
and
29 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
name: "E2E testing" | ||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
jobs: | ||
docker-images: | ||
name: "Build Docker images" | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
docker-images: | ||
- { name: "ghcr.io/cosmos/interchain-attestation-simapp", path: "testing/simapp.Dockerfile" } | ||
- { name: "ghcr.io/cosmos/interchain-attestation-rollupsimapp", path: "testing/rollupsimapp.Dockerfile" } | ||
- { name: "ghcr.io/cosmos/interchain-attestation-sidecar", path: "testing/sidecar.Dockerfile" } | ||
- { name: "ghcr.io/cosmos/interchain-attestation-mock-da", path: "testing/mock-da.Dockerfile" } | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-go@v5 # Useful because the docker builds caches the go modules | ||
with: | ||
go-version: 1.23 | ||
cache-dependency-path: | | ||
core/go.sum | ||
configmodule/go.sum | ||
sidecar/go.sum | ||
testing/interchaintest/go.sum | ||
testing/simapp/go.sum | ||
testing/rollupsimapp/go.sum | ||
- uses: docker/setup-buildx-action@v3 | ||
- uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Add SHORT_SHA env property with commit short sha | ||
run: echo "SHORT_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_ENV | ||
|
||
# TODO: Any nicer way to do this? :P | ||
- name: Set Tags | ||
run: | | ||
echo "COMMIT_TAG=${{ matrix.docker-images.name }}:${{ SHORT_SHA }}" >> $GITHUB_ENV | ||
if [ "${{ github.ref }}" = "refs/heads/main" ]; then | ||
echo "LATEST_TAG=${{ matrix.docker-images.name }}:latest" >> $GITHUB_ENV | ||
else | ||
echo "LATEST_TAG=" >> $GITHUB_ENV | ||
fi | ||
- name: Build | ||
uses: docker/build-push-action@v6 | ||
with: | ||
push: true | ||
context: . # Even though the docker images are in the testing directory, they need the root context | ||
file: ${{ matrix.docker-images.path }} | ||
tags: | | ||
${{ COMMIT_TAG }} | ||
${{ LATEST_TAG }} | ||
e2e: | ||
name: "E2E test" | ||
runs-on: ubuntu-latest | ||
needs: | ||
- docker-images | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-go@v5 | ||
with: | ||
go-version: 1.23 | ||
cache-dependency-path: | | ||
core/go.sum | ||
configmodule/go.sum | ||
sidecar/go.sum | ||
testing/interchaintest/go.sum | ||
testing/simapp/go.sum | ||
testing/rollupsimapp/go.sum | ||
- name: Install just | ||
uses: extractions/setup-just@v2 | ||
|
||
- name: Add SHORT_SHA env property with commit short sha | ||
run: echo "SHORT_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_ENV | ||
|
||
- name: Run e2e tests | ||
run: just test-e2e ${SHORT_SHA} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: "Linting" | ||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
jobs: | ||
lint: | ||
name: "Lint" | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
module: | ||
- core | ||
- configmodule | ||
- sidecar | ||
- testing/interchaintest | ||
- testing/simapp | ||
- testing/rollupsimapp | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version: 1.23 | ||
cache-dependency-path: | #We need all of them cached because many modules are shared | ||
core/go.sum | ||
configmodule/go.sum | ||
sidecar/go.sum | ||
testing/interchaintest/go.sum | ||
testing/simapp/go.sum | ||
testing/rollupsimapp/go.sum | ||
- name: Lint ${{ matrix.module }} | ||
uses: golangci/[email protected] | ||
with: | ||
version: v1.60 | ||
args: --timeout 5m | ||
working-directory: ${{ matrix.module }} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: "Unit testing" | ||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
jobs: | ||
lint: | ||
name: "Unit test" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-go@v5 | ||
with: | ||
go-version: 1.23 | ||
cache-dependency-path: | | ||
core/go.sum | ||
configmodule/go.sum | ||
sidecar/go.sum | ||
testing/interchaintest/go.sum | ||
testing/simapp/go.sum | ||
testing/rollupsimapp/go.sum | ||
- name: Install just | ||
uses: extractions/setup-just@v2 | ||
|
||
- name: Run tests | ||
run: just test-unit | ||
|
This file contains 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
This file contains 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
This file contains 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
This file contains 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