Legacy App Testing #1443
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
name: Legacy App Testing | |
on: | |
schedule: | |
- cron: "0 0,12 * * *" | |
release: | |
types: [published] | |
jobs: | |
cleanup-runs: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: rokroskar/workflow-run-cleanup-action@master | |
env: | |
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | |
if: "!startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/main'" | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
go-arch: ["amd64", "arm", "arm64"] | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-go@v3 | |
with: | |
go-version: 1.18 | |
- name: Build | |
run: GOARCH=${{ matrix.go-arch }} LEDGER_ENABLED=false make build | |
- name: Build cosmovisor | |
run: GOARCH=${{ matrix.go-arch }} LEDGER_ENABLED=false make cosmovisor | |
- name: Install runsim | |
run: go install github.com/cosmos/tools/cmd/[email protected] | |
- uses: actions/cache@v3 | |
with: | |
path: ~/go/bin | |
key: ${{ runner.os }}-go-runsim-binary | |
test-submodules: | |
runs-on: ubuntu-latest | |
container: tendermintdev/docker-tm-db-testing | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-go@v3 | |
with: | |
go-version: 1.18 | |
- name: Run submodule tests and create test coverage profile. | |
run: bash scripts/module-tests.sh | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: "${{ github.sha }}-go-submodules-coverage" | |
path: ./coverage-go-submod-profile.out | |
split-test-files: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-go@v3 | |
with: | |
go-version: 1.18 | |
- name: Create a file with all core Cosmos SDK pkgs | |
run: go list ./... > pkgs.txt | |
- name: Split pkgs into 4 files | |
run: split -d -n l/4 pkgs.txt pkgs.txt.part. | |
# cache multiple | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: "${{ github.sha }}-00" | |
path: ./pkgs.txt.part.00 | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: "${{ github.sha }}-01" | |
path: ./pkgs.txt.part.01 | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: "${{ github.sha }}-02" | |
path: ./pkgs.txt.part.02 | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: "${{ github.sha }}-03" | |
path: ./pkgs.txt.part.03 | |
tests: | |
runs-on: ubuntu-latest | |
needs: split-test-files | |
strategy: | |
fail-fast: false | |
matrix: | |
part: ["00", "01", "02", "03"] | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-go@v3 | |
with: | |
go-version: 1.18 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: "${{ github.sha }}-${{ matrix.part }}" | |
- name: test & coverage report creation | |
run: | | |
cat pkgs.txt.part.${{ matrix.part }} | xargs go test -mod=readonly -timeout 30m -coverprofile=${{ matrix.part }}profile.out -covermode=atomic -tags='legacy_simapp norace ledger test_ledger_mock' | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: "${{ github.sha }}-${{ matrix.part }}-coverage" | |
path: ./${{ matrix.part }}profile.out | |
sims-notify-success: | |
needs: [tests] | |
runs-on: ubuntu-latest | |
if: ${{ success() }} | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v3 | |
- name: Get previous workflow status | |
uses: ./.github/actions/last-workflow-status | |
id: last_status | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Notify Slack on success | |
if: ${{ steps.last_status.outputs.last_status == 'failure' }} | |
uses: rtCamp/action-slack-notify@12e36fc18b0689399306c2e0b3e0f2978b7f1ee7 | |
env: | |
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} | |
SLACK_CHANNEL: cosmos-sdk-legacy-app | |
SLACK_USERNAME: Legacy App Tests | |
SLACK_ICON_EMOJI: ":white_check_mark:" | |
SLACK_COLOR: good | |
SLACK_MESSAGE: Legacy app tests are passing | |
SLACK_FOOTER: "" | |
sims-notify-failure: | |
needs: [tests] | |
runs-on: ubuntu-latest | |
if: ${{ failure() }} | |
steps: | |
- name: Notify Slack on failure | |
uses: rtCamp/action-slack-notify@12e36fc18b0689399306c2e0b3e0f2978b7f1ee7 | |
env: | |
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} | |
SLACK_CHANNEL: cosmos-sdk-legacy-app | |
SLACK_USERNAME: Legacy App Tests | |
SLACK_ICON_EMOJI: ":skull:" | |
SLACK_COLOR: danger | |
SLACK_MESSAGE: Legacy app tests are failing | |
SLACK_FOOTER: "" |