Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test precompiles ibc #4

Open
wants to merge 3 commits into
base: test-precompiles
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- uses: actions/[email protected]
- uses: actions/[email protected]
with:
go-version: 1.17
go-version: 1.18
- uses: technote-space/get-diff-action@v5
id: git_diff
with:
Expand All @@ -44,7 +44,7 @@ jobs:
- uses: actions/[email protected]
- uses: actions/[email protected]
with:
go-version: 1.17
go-version: 1.18
- uses: technote-space/get-diff-action@v5
id: git_diff
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.17
go-version: 1.18
- uses: actions/[email protected]
- uses: technote-space/get-diff-action@v5
with:
Expand Down
289 changes: 289 additions & 0 deletions .github/workflows/sims.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,289 @@
name: Sims
# Sims workflow runs multiple types of simulations (nondeterminism, import-export, after-import, multi-seed-short)
# This workflow will run on main and release branches, if a .go, .mod or .sum file have been changed
on:
push:
paths-ignore:
- 'docs/**'
branches:
- main
- release/**
tags:
- "*"
pull_request:
types: auto_merge_enabled
issue_comment:
types: [created, edited]

jobs:
build:
runs-on: ubuntu-latest
permissions:
pull-requests: write
if: >-
(github.event_name == 'issue_comment' && startsWith(github.event.comment.body, '/runsim')) ||
github.event_name == 'push' || github.event_name == 'pull_request'
outputs:
repo_name: ${{ steps.pr_data.outputs.repo_name }}
ref: ${{ steps.pr_data.outputs.ref }}
steps:
# if we could have secrets.ORG_READ_BOT_PAT, we can check against team rather than organization.
- uses: tspascoal/[email protected]
id: checkMember
if: github.event_name == 'issue_comment'
with:
username: ${{ github.actor }}
team: 'cronos-dev'
GITHUB_TOKEN: ${{ secrets.ORG_READ_BOT_PAT }}
- name: Comment PR for authentication failure
uses: crypto-org-chain/actions-pull-request-add-comment@master
if: (steps.checkMember.outputs.isTeamMember == 'false') && (github.event_name == 'issue_comment')
with:
message: |
Sorry only cronos-dev team member could run simulations by '/runsim'.
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Fail and exit the job if authentication failed
if: (steps.checkMember.outputs.isTeamMember == 'false') && (github.event_name == 'issue_comment')
run: exit 1
- name: Comment PR for Sim test started
uses: crypto-org-chain/actions-pull-request-add-comment@master
if: github.event_name == 'issue_comment'
with:
message: |
Simulation tests started and triggered by `/runsim`.
Can check further progress [here](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Github API Request
id: request
uses: octokit/[email protected]
if: github.event_name == 'issue_comment'
with:
route: ${{ github.event.issue.pull_request.url }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Get Comment PR informations
id: pr_data
if: github.event_name == 'issue_comment'
run: |
echo "::set-output name=repo_name::${{ fromJson(steps.request.outputs.data).head.repo.full_name }}"
comment_hash=`echo ${{ github.event.comment.body }} | cut -d' ' -f2` # get commit hash if any
if [[ "${comment_hash}" == "/runsim" ]]; then
echo "::set-output name=ref::${{ fromJson(steps.request.outputs.data).head.ref }}" # use default head ref
else
echo "::set-output name=ref::${comment_hash}" # use comment provided ref
fi
- name: Checkout Comment PR Branch
uses: actions/checkout@v2
if: github.event_name == 'issue_comment'
with:
submodules: true
token: ${{ secrets.GITHUB_TOKEN }}
repository: ${{ steps.pr_data.outputs.repo_name }}
ref: ${{ steps.pr_data.outputs.ref }}
- name: Normal check out code
uses: actions/checkout@v2
with:
submodules: true
if: github.event_name == 'push' || github.event_name == 'pull_request'
- uses: actions/[email protected]
with:
go-version: 1.18
- name: Display go version
run: go version
- run: make build

install-runsim:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/[email protected]
with:
go-version: 1.18
- name: Display go version
run: go version
- name: Install runsim
run: export GO111MODULE="on" && go install github.com/cosmos/tools/cmd/[email protected]
- uses: actions/[email protected]
with:
path: ~/go/bin
key: ${{ runner.os }}-go-runsim-binary

test-sim-nondeterminism:
runs-on: ubuntu-latest
needs: [build, install-runsim]
steps:
- uses: actions/setup-go@v2
with:
go-version: 1.18.3
- name: Checkout Comment PR Branch
uses: actions/checkout@v2
if: github.event_name == 'issue_comment'
with:
submodules: true
token: ${{ secrets.GITHUB_TOKEN }}
repository: ${{ needs.build.outputs.repo_name }}
ref: ${{ needs.build.outputs.ref }}
- name: Normal check out code
uses: actions/checkout@v2
if: github.event_name == 'push' || github.event_name == 'pull_request'
with:
submodules: true
- name: Display go version
run: go version
# the original repo technote-space does not include auto_merge_enabled into target events
# we can move back after this pr merged: https://github.com/technote-space/get-diff-action/pull/193
- uses: adu-crypto/get-diff-action@gh-actions
with:
PATTERNS: |
**/**.go
go.mod
go.sum
if: github.event_name == 'push' || github.event_name == 'pull_request'
- uses: actions/[email protected]
with:
path: ~/go/bin
key: ${{ runner.os }}-go-runsim-binary
if: >-
(env.GIT_DIFF && (github.event_name == 'push' || github.event_name == 'pull_request')) ||
(github.event_name == 'issue_comment' && startsWith(github.event.comment.body, '/runsim'))
- name: test-sim-nondeterminism
run: |
make test-sim-nondeterminism
if: >-
(env.GIT_DIFF && (github.event_name == 'push' || github.event_name == 'pull_request')) ||
(github.event_name == 'issue_comment' && startsWith(github.event.comment.body, '/runsim'))

test-sim-import-export:
runs-on: ubuntu-latest
needs: [build, install-runsim]
steps:
- uses: actions/setup-go@v2
with:
go-version: 1.18.3
- name: Checkout Comment PR Branch
uses: actions/checkout@v2
if: github.event_name == 'issue_comment'
with:
submodules: true
token: ${{ secrets.GITHUB_TOKEN }}
repository: ${{ needs.build.outputs.repo_name }}
ref: ${{ needs.build.outputs.ref }}
- name: Normal check out code
uses: actions/checkout@v2
if: github.event_name == 'push' || github.event_name == 'pull_request'
with:
submodules: true
- name: Display go version
run: go version
# the original repo technote-space does not include auto_merge_enabled into target events
# we can move back after this pr merged: https://github.com/technote-space/get-diff-action/pull/193
- uses: adu-crypto/get-diff-action@gh-actions
with:
PATTERNS: |
**/**.go
go.mod
go.sum
if: github.event_name == 'push' || github.event_name == 'pull_request'
- uses: actions/[email protected]
with:
path: ~/go/bin
key: ${{ runner.os }}-go-runsim-binary
if: >-
(env.GIT_DIFF && (github.event_name == 'push' || github.event_name == 'pull_request')) ||
(github.event_name == 'issue_comment' && startsWith(github.event.comment.body, '/runsim'))
- name: test-sim-import-export
run: |
make test-sim-import-export
if: >-
(env.GIT_DIFF && (github.event_name == 'push' || github.event_name == 'pull_request')) ||
(github.event_name == 'issue_comment' && startsWith(github.event.comment.body, '/runsim'))

test-sim-after-import:
runs-on: ubuntu-latest
needs: [build, install-runsim]
steps:
- uses: actions/setup-go@v2
with:
go-version: 1.18.3
- name: Checkout Comment PR Branch
uses: actions/checkout@v2
if: github.event_name == 'issue_comment'
with:
submodules: true
token: ${{ secrets.GITHUB_TOKEN }}
repository: ${{ needs.build.outputs.repo_name }}
ref: ${{ needs.build.outputs.ref }}
- name: Normal check out code
uses: actions/checkout@v2
if: github.event_name == 'push' || github.event_name == 'pull_request'
with:
submodules: true
- name: Display go version
run: go version
# the original repo technote-space does not include auto_merge_enabled into target events
# we can move back after this pr merged: https://github.com/technote-space/get-diff-action/pull/193
- uses: adu-crypto/get-diff-action@gh-actions
with:
PATTERNS: |
**/**.go
go.mod
go.sum
if: github.event_name == 'push' || github.event_name == 'pull_request'
- uses: actions/[email protected]
with:
path: ~/go/bin
key: ${{ runner.os }}-go-runsim-binary
if: >-
(env.GIT_DIFF && (github.event_name == 'push' || github.event_name == 'pull_request')) ||
(github.event_name == 'issue_comment' && startsWith(github.event.comment.body, '/runsim'))
- name: test-sim-after-import
run: |
make test-sim-after-import
if: >-
(env.GIT_DIFF && (github.event_name == 'push' || github.event_name == 'pull_request')) ||
(github.event_name == 'issue_comment' && startsWith(github.event.comment.body, '/runsim'))

test-sim-multi-seed-short:
runs-on: ubuntu-latest
needs: [build, install-runsim]
steps:
- uses: actions/setup-go@v2
with:
go-version: 1.18.3
- name: Checkout Comment PR Branch
uses: actions/checkout@v2
if: github.event_name == 'issue_comment'
with:
submodules: true
token: ${{ secrets.GITHUB_TOKEN }}
repository: ${{ needs.build.outputs.repo_name }}
ref: ${{ needs.build.outputs.ref }}
- name: Normal check out code
uses: actions/checkout@v2
if: github.event_name == 'push' || github.event_name == 'pull_request'
with:
submodules: true
- name: Display go version
run: go version
# the original repo technote-space does not include auto_merge_enabled into target events
# we can move back after this pr merged: https://github.com/technote-space/get-diff-action/pull/193
- uses: adu-crypto/get-diff-action@gh-actions
with:
PATTERNS: |
**/**.go
go.mod
go.sum
if: github.event_name == 'push' || github.event_name == 'pull_request'
- uses: actions/[email protected]
with:
path: ~/go/bin
key: ${{ runner.os }}-go-runsim-binary
if: >-
(env.GIT_DIFF && (github.event_name == 'push' || github.event_name == 'pull_request')) ||
(github.event_name == 'issue_comment' && startsWith(github.event.comment.body, '/runsim'))
- name: test-sim-multi-seed-short
run: |
make test-sim-multi-seed-short
if: >-
(env.GIT_DIFF && (github.event_name == 'push' || github.event_name == 'pull_request')) ||
(github.event_name == 'issue_comment' && startsWith(github.event.comment.body, '/runsim'))
20 changes: 20 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,23 @@ jobs:
name: debug-files
path: debug_files.tar.gz
if-no-files-found: ignore

upload-cache:
if: github.event_name == 'push'
needs: ["integration_tests"]
strategy:
matrix:
os: [macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: cachix/install-nix-action@v15
- uses: cachix/cachix-action@v10
with:
name: cronos
extraPullNames: dapp
# github don't pass secrets for pull request from fork repos,
# in that case the push is disabled naturally.
signingKey: "${{ secrets.CACHIX_SIGNING_KEY }}"
- name: 'instantiate integration test env'
run: nix-store -r $(nix-instantiate integration_tests/shell.nix)
Loading