Skip to content

Nightly Tests

Nightly Tests #393

Workflow file for this run

name: Nightly Tests
on:
workflow_dispatch:
schedule:
- cron: 30 1 * * *
jobs:
golangci:
name: Lint
runs-on:
- self-hosted
- linux
container: ubuntu:22.04
steps:
- name: Install dependencies
id: dependencies
run: |
apt update
apt install -y build-essential libstdc++6 software-properties-common make gcc git curl tar
- name: Check out code into the Go module directory
id: checkout
uses: actions/checkout@v4
- name: install go
id: go
uses: actions/setup-go@v4
with:
go-version: "1.20"
- name: Run global scope golangci-lint
id: global_lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.53.2
args: --timeout 10m0s
skip-pkg-cache: true
- name: Run golangci-lint on wasp-cli
uses: golangci/golangci-lint-action@v3
with:
working-directory: tools/wasp-cli
version: v1.53.2
args: --timeout 10m0s
skip-pkg-cache: true
- name: Get the job name
id: get_job_name
if: "${{ failure() }}"
uses: mikefarah/yq@master
with:
cmd: yq '.jobs.${{ github.job }}.name' .github/workflows/heavy-tests.yml
- name: prepare reporting outputs
if: "${{ failure() }}"
id: prepare_outputs
run: |
apt install jq -y
echo github_steps=$(echo '${{ toJSON(steps) }}' | jq -r -c . | sed -e 's:\":\\\":g') >> $GITHUB_OUTPUT
echo "::group::Install JQ"
apt update && apt install jq -y
echo "::endgroup::"
echo "job name result ${{ steps.get_job_name.outputs.result }}"
if [ "${{ steps.get_job_name.outputs.result }}" != "null" ]; then
if [ "${{ matrix.TEST_LANG }}" ]; then
echo job_name="${{ steps.get_job_name.outputs.result }} (${{ matrix.TEST_LANG }})" >> $GITHUB_OUTPUT
else
echo job_name="${{ steps.get_job_name.outputs.result }}" >> $GITHUB_OUTPUT
fi
else
echo job_name=${{ github.job }} >> $GITHUB_OUTPUT
fi
echo github_steps=$(echo '${{ toJSON(steps) }}' | jq -r -c . | sed -e
's:\":\\\":g') >> $GITHUB_OUTPUT
- name: The job has failed
if: ${{ failure() }}
uses: slackapi/[email protected]
with:
payload: |
{
"job": "${{ github.job }}",
"job_name" : "${{ steps.prepare_outputs.outputs.job_name }}",
"steps": "${{ steps.prepare_outputs.outputs.github_steps }}",
"run_number": "${{ github.run_number }}",
"run_attempt": "${{ github.run_attempt }}",
"workflow": "${{ github.workflow }}",
"sha": "${{ github.sha }}",
"ref": "${{ github.ref_name }}",
"run_id": "${{ github.run_id }}",
"server_url": "${{ github.server_url }}",
"repository": "${{ github.repository }}"
}
env:
SLACK_WEBHOOK_URL: "${{ secrets.SLACK_WEBHOOK_URL }}"
contract-test:
name: Wasm contract tests
runs-on:
- self-hosted
- linux
container: ubuntu:22.04
strategy:
matrix:
TEST_LANG:
- go
- gowasm
- tswasm
- rswasm
steps:
- name: Install dependencies
id: dependencies
run: |
apt update
apt install -y build-essential libstdc++6 software-properties-common make gcc git wget curl tar
- name: checkout to the directory
id: checkout
uses: actions/checkout@v4
- name: install golang
id: go
uses: actions/setup-go@v4
with:
go-version: "1.20"
- name: install tinygo
id: tinygo
run: >
wget
https://github.com/tinygo-org/tinygo/releases/download/v0.27.0/tinygo_0.27.0_amd64.deb
dpkg -i tinygo_0.27.0_amd64.deb
export PATH=$PATH:/usr/local/bin
- name: install rust-toolchain
id: rust
uses: actions-rs/[email protected]
with:
toolchain: stable
- name: install wasm-pack
id: wasm-pack
run: |
curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
- name: install Node.js
id: node
uses: actions/setup-node@v3
with:
node-version: 18
- name: install schema
id: schema
run: |
git config --global --add safe.directory /__w/wasp/wasp
root_path=$(git rev-parse --show-toplevel)
go install $root_path/tools/schema
schema -go
- name: run builds
env:
TEST_LANG: ${{matrix.TEST_LANG}}
run: |
cd contracts/wasm/scripts
bash core_build.sh
if [ $TEST_LANG == "gowasm" ]; then
bash go_all.sh
elif [ $TEST_LANG == "tswasm" ]; then
bash ts_all.sh
elif [ $TEST_LANG == "rswasm" ]; then
bash rust_all.sh ci
fi
- name: run tests
env:
TEST_LANG: ${{matrix.TEST_LANG}}
run: |
cd contracts/wasm
if [ $TEST_LANG == "go" ]; then
go test ./...
elif [ $TEST_LANG == "gowasm" ]; then
go test ./... -gowasm
elif [ $TEST_LANG == "tswasm" ]; then
go test ./... -tswasm
elif [ $TEST_LANG == "rswasm" ]; then
go test ./... -rswasm
fi
- name: Get the job name
id: get_job_name
if: "${{ failure() }}"
uses: mikefarah/yq@master
with:
cmd: yq '.jobs.${{ github.job }}.name' .github/workflows/heavy-tests.yml
- name: prepare reporting outputs
if: "${{ failure() }}"
id: prepare_outputs
run: |
apt install jq -y
echo github_steps=$(echo '${{ toJSON(steps) }}' | jq -r -c . | sed -e 's:\":\\\":g') >> $GITHUB_OUTPUT
echo "::group::Install JQ"
apt update && apt install jq -y
echo "::endgroup::"
echo "job name result ${{ steps.get_job_name.outputs.result }}"
if [ "${{ steps.get_job_name.outputs.result }}" != "null" ]; then
if [ "${{ matrix.TEST_LANG }}" ]; then
echo job_name="${{ steps.get_job_name.outputs.result }} (${{ matrix.TEST_LANG }})" >> $GITHUB_OUTPUT
else
echo job_name="${{ steps.get_job_name.outputs.result }}" >> $GITHUB_OUTPUT
fi
else
echo job_name=${{ github.job }} >> $GITHUB_OUTPUT
fi
echo github_steps=$(echo '${{ toJSON(steps) }}' | jq -r -c . | sed -e
's:\":\\\":g') >> $GITHUB_OUTPUT
- name: The job has failed
if: ${{ failure() }}
uses: slackapi/[email protected]
with:
payload: |
{
"job": "${{ github.job }}",
"job_name" : "${{ steps.prepare_outputs.outputs.job_name }}",
"steps": "${{ steps.prepare_outputs.outputs.github_steps }}",
"run_number": "${{ github.run_number }}",
"run_attempt": "${{ github.run_attempt }}",
"workflow": "${{ github.workflow }}",
"sha": "${{ github.sha }}",
"ref": "${{ github.ref_name }}",
"run_id": "${{ github.run_id }}",
"server_url": "${{ github.server_url }}",
"repository": "${{ github.repository }}"
}
env:
SLACK_WEBHOOK_URL: "${{ secrets.SLACK_WEBHOOK_URL }}"
test:
name: Test
runs-on:
- self-hosted
container: ubuntu:22.04
steps:
- name: Install dependencies
id: dependencies
run: |
apt update
apt install -y build-essential libstdc++6 software-properties-common make gcc git curl tar
- name: Check out code into the Go module directory
id: checkout
uses: actions/checkout@v4
- name: Set up Go 1.x
id: go
uses: actions/setup-go@v4
with:
go-version: "1.20"
- name: Cache Hornet
id: cache_hornet
uses: actions/[email protected]
with:
key: hornet-${{ hashFiles('**/go.mod', '**/go.sum') }}
path: |
/usr/local/bin/hornet
/usr/local/bin/inx-indexer
/usr/local/bin/inx-coordinator
/usr/local/bin/inx-faucet
- name: Checkout Hornet
id: hornet
uses: actions/checkout@v4
if: steps.cache_hornet.outputs.cache-hit != 'true'
with:
repository: iotaledger/hornet
ref: ${{ vars.HORNET_VERSION }}
path: hornet
- name: Build hornet
id: build_hornet
if: steps.cache_hornet.outputs.cache-hit != 'true'
run: |
cd hornet
go mod download
go mod verify
go build -o /usr/local/bin/hornet -a -tags=rocksdb -ldflags='-w -s'
- name: Checkout Indexer
id: inx-indexer
if: steps.cache_hornet.outputs.cache-hit != 'true'
uses: actions/checkout@v4
with:
repository: iotaledger/inx-indexer
ref: ${{ vars.INX_INDEXER_VERSION }}
path: inx-indexer
- name: Build Indexer
id: build_indexer
if: steps.cache_hornet.outputs.cache-hit != 'true'
run: |
cd inx-indexer
go mod download
go mod verify
go build -o /usr/local/bin/inx-indexer -a
- name: Checkout Coordinator
id: inx_coordinator
if: steps.cache_hornet.outputs.cache-hit != 'true'
uses: actions/checkout@v4
with:
repository: iotaledger/inx-coordinator
ref: ${{ vars.INX_COORDINATOR_VERSION }}
path: inx-coordinator
- name: Build Coordinator
id: build_coordinator
if: steps.cache_hornet.outputs.cache-hit != 'true'
run: |
cd inx-coordinator
go mod download
go mod verify
go build -o /usr/local/bin/inx-coordinator -a
- name: Checkout Faucet
id: inx-faucet
if: steps.cache_hornet.outputs.cache-hit != 'true'
uses: actions/checkout@v4
with:
repository: iotaledger/inx-faucet
ref: ${{ vars.INX_FAUCET_VERSION }}
path: inx-faucet
- name: Build Faucet
id: build_faucet
if: steps.cache_hornet.outputs.cache-hit != 'true'
run: |
cd inx-faucet
go mod download
go mod verify
git submodule update --init --recursive
go build -o /usr/local/bin/inx-faucet -a
- name: Get dependencies
id: go_dependencies
run: |
git config --global --add safe.directory /__w/wasp/wasp
make wasm
go get -v -t -d ./...
- name: Build
id: build
run: make build
- name: Test
id: test
run: |
make test GIT_REF_TAG="v0.0.0+${{ github.sha }}"
make test-full GIT_REF_TAG="v0.0.0+${{ github.sha }}"
- name: Get the job name
id: get_job_name
if: "${{ failure() }}"
uses: mikefarah/yq@master
with:
cmd: yq '.jobs.${{ github.job }}.name' .github/workflows/heavy-tests.yml
- name: prepare reporting outputs
if: "${{ failure() }}"
id: prepare_outputs
run: |
apt install jq -y
echo github_steps=$(echo '${{ toJSON(steps) }}' | jq -r -c . | sed -e 's:\":\\\":g') >> $GITHUB_OUTPUT
echo "::group::Install JQ"
apt update && apt install jq -y
echo "::endgroup::"
echo "job name result ${{ steps.get_job_name.outputs.result }}"
if [ "${{ steps.get_job_name.outputs.result }}" != "null" ]; then
if [ "${{ matrix.TEST_LANG }}" ]; then
echo job_name="${{ steps.get_job_name.outputs.result }} (${{ matrix.TEST_LANG }})" >> $GITHUB_OUTPUT
else
echo job_name="${{ steps.get_job_name.outputs.result }}" >> $GITHUB_OUTPUT
fi
else
echo job_name=${{ github.job }} >> $GITHUB_OUTPUT
fi
echo github_steps=$(echo '${{ toJSON(steps) }}' | jq -r -c . | sed -e
's:\":\\\":g') >> $GITHUB_OUTPUT
- name: The job has failed
if: ${{ failure() }}
uses: slackapi/[email protected]
with:
payload: |
{
"job": "${{ github.job }}",
"job_name" : "${{ steps.prepare_outputs.outputs.job_name }}",
"steps": "${{ steps.prepare_outputs.outputs.github_steps }}",
"run_number": "${{ github.run_number }}",
"run_attempt": "${{ github.run_attempt }}",
"workflow": "${{ github.workflow }}",
"sha": "${{ github.sha }}",
"ref": "${{ github.ref_name }}",
"run_id": "${{ github.run_id }}",
"server_url": "${{ github.server_url }}",
"repository": "${{ github.repository }}"
}
env:
SLACK_WEBHOOK_URL: "${{ secrets.SLACK_WEBHOOK_URL }}"