Skip to content

Commit

Permalink
use matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
vimystic committed Sep 12, 2023
1 parent 7704ff6 commit d606e3a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 116 deletions.
120 changes: 19 additions & 101 deletions .github/workflows/interchaintest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -133,92 +133,28 @@ jobs:
- name: interchaintest
run: make interchaintest-fee-grant

scenarios-client:
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.21
uses: actions/setup-go@v4
with:
go-version: '1.21'

- name: checkout relayer
uses: actions/checkout@v2

- uses: actions/cache@v1
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: interchaintest
run: make interchaintest-scenario-client

scenarios-ica:
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.21
uses: actions/setup-go@v4
with:
go-version: '1.21'

- name: checkout relayer
uses: actions/checkout@v2

- uses: actions/cache@v1
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: interchaintest
run: make interchaintest-scenario-ica

scenarios-interchainaccounts:
prepare-matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Set up Go 1.21
uses: actions/setup-go@v4
with:
go-version: '1.21'
- name: Checkout code
uses: actions/checkout@v2

- name: checkout relayer
uses: actions/checkout@v2
- name: Generate matrix
id: set-matrix
run: |
# Run the command and convert its output to a JSON array
TESTS=$(go test -list ^TEST | jq -R -s -c 'split("\n")[:-1]')
echo "::set-output name=matrix::${TESTS}"
- uses: actions/cache@v1
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: interchaintest
run: make interchaintest-scenario-interchainaccounts

scenarios-pathfilter:
scenarios-client:
needs: prepare-matrix
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.21
uses: actions/setup-go@v4
with:
go-version: '1.21'

- name: checkout relayer
uses: actions/checkout@v2

- uses: actions/cache@v1
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
strategy:
matrix:
test: ${{fromJson(needs.prepare-matrix.outputs.matrix)}}

- name: interchaintest
run: make interchaintest-scenario-pathfilter

scenarios-tendermint:
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.21
uses: actions/setup-go@v4
Expand All @@ -228,26 +164,7 @@ jobs:
- name: checkout relayer
uses: actions/checkout@v2

- uses: actions/cache@v1
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: interchaintest
run: make interchaintest-scenario-tendermint

scenarios-stride:
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.21
uses: actions/setup-go@v4
with:
go-version: '1.21'

- name: checkout relayer
uses: actions/checkout@v2


- uses: actions/cache@v1
with:
Expand All @@ -257,4 +174,5 @@ jobs:
${{ runner.os }}-go-
- name: interchaintest
run: make interchaintest-scenario-stride
run: |
go test -run ${{ matrix.test }}
16 changes: 1 addition & 15 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -92,23 +92,9 @@ interchaintest-fee-grant:
cd interchaintest && go test -race -v -run TestRelayerFeeGrant .

## Scenario tests are suitable for simple networks of 1 validator and no full nodes. They test specific functionality.
interchaintest-scenario-client:
interchaintest-scenario:
cd interchaintest && go test -timeout 30m -race -v -run TestScenarioClient ./...

interchaintest-scenario-ica:
cd interchaintest && go test -timeout 30m -race -v -run TestScenarioICA ./...

interchaintest-scenario-interchainaccounts:
cd interchaintest && go test -timeout 30m -race -v -run TestScenarioInterchainAccounts ./...

interchaintest-scenario-pathfilter:
cd interchaintest && go test -timeout 30m -race -v -run TestScenarioPathFilter ./...

interchaintest-scenario-tendermint:
cd interchaintest && go test -timeout 30m -race -v -run TestScenarioTendermint ./...

interchaintest-scenario-stride:
cd interchaintest && go test -timeout 30m -race -v -run TestScenarioStride ./...

coverage:
@echo "viewing test coverage..."
Expand Down

0 comments on commit d606e3a

Please sign in to comment.