Skip to content

Commit

Permalink
Update CI to work with PR's from forks (backport #187) (#205)
Browse files Browse the repository at this point in the history
Co-authored-by: Dan Kanefsky <[email protected]>
  • Loading branch information
mergify[bot] and boojamya authored Jul 14, 2023
1 parent 1e5ed6b commit ddccc4c
Show file tree
Hide file tree
Showing 13 changed files with 153 additions and 283 deletions.
175 changes: 0 additions & 175 deletions .github/workflows/docker-publish-and-E2E.yaml

This file was deleted.

53 changes: 53 additions & 0 deletions .github/workflows/docker-publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Create and Push Docker Image

on:
push:
tags:
- '**'
branches:
- '**'

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Build and push Docker image
uses: docker/build-push-action@v3
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
72 changes: 72 additions & 0 deletions .github/workflows/e2e-tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: End to End Tests

on:
pull_request:

env:
TAR_PATH: ./binary_docker

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build-docker:
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.19
uses: actions/setup-go@v3
with:
go-version: 1.19

- name: checkout chain
uses: actions/checkout@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Build Docker image
uses: docker/build-push-action@v3
with:
context: .
platforms: linux/amd64
tags: noble:local
# Export tarball image to upload and share with other runners
outputs: type=docker,dest=${{ env.TAR_PATH }}
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Publish Tarball as Artifact
uses: actions/upload-artifact@v3
with:
name: noble-docker-image
path: ${{ env.TAR_PATH }}

e2e-tests:
needs: build-docker
runs-on: ubuntu-latest
strategy:
matrix:
# names of `make` commands to run tests
test: ["ictest-tkn-factory", "ictest-packet-forward", "ictest-paramauthority", "ictest-chain-upgrade-noble-1", "ictest-chain-upgrade-grand-1", "ictest-globalFee", "ictest-ics20-bps-fees"]
fail-fast: false

steps:
- name: Set up Go 1.19
uses: actions/setup-go@v3
with:
go-version: 1.19

- name: checkout chain
uses: actions/checkout@v3

- name: Download Tarball Artifact
uses: actions/download-artifact@v3
with:
name: noble-docker-image

- name: Load Docker Image
run: docker image load -i ${{ env.TAR_PATH }}

- name: run test
run: make ${{ matrix.test }}
6 changes: 1 addition & 5 deletions .github/workflows/unit-tests.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
name: Unit Tests

on:
push:
tags:
- '**'
branches:
- '**'
pull_request:

jobs:
unit-tests:
Expand Down
19 changes: 0 additions & 19 deletions interchaintest/ci_integration.go

This file was deleted.

10 changes: 10 additions & 0 deletions interchaintest/genesis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,16 @@ import (
upgradetypes "github.com/strangelove-ventures/paramauthority/x/upgrade/types"
)

var (
nobleImageInfo = []ibc.DockerImage{
{
Repository: "noble",
Version: "local",
UidGid: "1025:1025",
},
}
)

var (
denomMetadataFrienzies = DenomMetadata{
Display: "ufrienzies",
Expand Down
12 changes: 2 additions & 10 deletions interchaintest/globalfee_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ import (
"github.com/strangelove-ventures/interchaintest/v3/ibc"
"github.com/strangelove-ventures/interchaintest/v3/testreporter"
"github.com/strangelove-ventures/noble/cmd"
integration "github.com/strangelove-ventures/noble/interchaintest"
proposaltypes "github.com/strangelove-ventures/paramauthority/x/params/types/proposal"
"github.com/stretchr/testify/require"
"go.uber.org/zap/zaptest"
)

// run `make local-image`to rebuild updated binary before running test
func TestGlobalFee(t *testing.T) {
if testing.Short() {
t.Skip()
Expand All @@ -33,8 +33,6 @@ func TestGlobalFee(t *testing.T) {

client, network := interchaintest.DockerSetup(t)

repo, version := integration.GetDockerImageInfo()

var (
noble *cosmos.CosmosChain
roles NobleRoles
Expand All @@ -55,13 +53,7 @@ func TestGlobalFee(t *testing.T) {
GasAdjustment: 1.1,
TrustingPeriod: "504h",
NoHostMount: false,
Images: []ibc.DockerImage{
{
Repository: repo,
Version: version,
UidGid: "1025:1025",
},
},
Images: nobleImageInfo,
EncodingConfig: NobleEncoding(),
PreGenesis: func(cc ibc.ChainConfig) (err error) {
val := noble.Validators[0]
Expand Down
Loading

0 comments on commit ddccc4c

Please sign in to comment.