Update codeowners #3158
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: HyperSDK CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
go-mod-tidy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: ./.github/actions/install-go | |
- shell: bash | |
run: go mod tidy | |
- shell: bash | |
working-directory: ./examples/morpheusvm | |
run: go mod tidy | |
- shell: bash | |
run: git diff | |
- shell: bash | |
run: scripts/tests.clean.sh | |
hypersdk-lint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: ./.github/actions/install-go | |
- name: Run static analysis tests | |
shell: bash | |
run: scripts/lint.sh | |
- name: Run shellcheck | |
shell: bash | |
run: scripts/tests.shellcheck.sh | |
- name: Run actionlint | |
shell: bash | |
run: scripts/tests.actionlint.sh | |
hypersdk-unit-tests: | |
runs-on: ubuntu-20.04-32 | |
timeout-minutes: 10 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: ./.github/actions/install-go | |
- name: Install Rust | |
uses: ./.github/actions/install-rust | |
with: | |
targets: wasm32-unknown-unknown | |
cache: false | |
- name: Run unit tests | |
shell: bash | |
run: scripts/tests.unit.sh | |
hypersdk-benchmark-tests: | |
runs-on: ubuntu-20.04-32 | |
timeout-minutes: 10 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: ./.github/actions/install-go | |
- name: Install Rust | |
uses: ./.github/actions/install-rust | |
with: | |
targets: wasm32-unknown-unknown | |
cache: false | |
- name: Run unit tests | |
shell: bash | |
run: scripts/tests.benchmark.sh | |
hypersdk-tests: | |
runs-on: ubuntu-latest | |
needs: [go-mod-tidy, hypersdk-lint, hypersdk-unit-tests] | |
outputs: | |
only_contracts_changed: ${{ steps.check_changes.outputs.only_contracts_changed }} | |
steps: | |
- name: Finished HyperSDK tests | |
run: echo "Finished HyperSDK tests" | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Check changes | |
id: check_changes | |
run: | | |
diff=$(git diff --name-only HEAD origin/main) | |
printf "diff:\n%s\n" "$diff" | |
output=$(echo "$diff" | grep -v '^x/contracts/' | grep -v '^Cargo.toml$' || true) | |
if [ -n "$diff" ] && [ -z "$output" ]; then | |
echo "only x/contracts changed, will skip unafected tests" | |
echo "only_contracts_changed=true" >> "$GITHUB_OUTPUT" | |
else | |
echo "cannot skip tests" | |
echo "only_contracts_changed=false" >> "$GITHUB_OUTPUT" | |
fi | |
# MorpheusVM | |
morpheusvm-lint: | |
needs: [hypersdk-tests] | |
if: ${{ needs.hypersdk-tests.outputs.only_contracts_changed != 'true' }} | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: ./.github/actions/install-go | |
with: | |
cache-dependency-path: | | |
go.sum | |
examples/morpheusvm/go.sum | |
- name: Run static analysis tests | |
working-directory: ./examples/morpheusvm | |
shell: bash | |
run: scripts/lint.sh | |
- name: Build vm, cli | |
working-directory: ./examples/morpheusvm | |
shell: bash | |
run: scripts/build.sh | |
morpheusvm-unit-tests: | |
needs: [hypersdk-tests] | |
if: ${{ needs.hypersdk-tests.outputs.only_contracts_changed != 'true' }} | |
runs-on: ubuntu-20.04-32 | |
timeout-minutes: 10 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: ./.github/actions/install-go | |
with: | |
cache-dependency-path: | | |
go.sum | |
examples/morpheusvm/go.sum | |
- name: Run unit tests | |
working-directory: ./examples/morpheusvm | |
shell: bash | |
run: scripts/tests.unit.sh | |
- name: Run integration tests | |
working-directory: ./examples/morpheusvm | |
shell: bash | |
run: scripts/tests.integration.sh | |
morpheusvm-e2e-tests: | |
needs: [morpheusvm-lint, morpheusvm-unit-tests] | |
runs-on: ubuntu-20.04-32 | |
timeout-minutes: 25 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: ./.github/actions/install-go | |
with: | |
cache-dependency-path: | | |
go.sum | |
examples/morpheusvm/go.sum | |
- name: Run e2e tests | |
working-directory: ./examples/morpheusvm | |
shell: bash | |
run: scripts/run.sh | |
env: | |
MODE: 'test' | |
- name: Upload tmpnet network dir | |
uses: ava-labs/avalanchego/.github/actions/upload-tmpnet-artifact@v1-actions | |
if: always() | |
with: | |
name: morpheusvm-e2e-tmpnet-data | |
morpheusvm-release: | |
needs: [morpheusvm-e2e-tests] | |
# We build with 20.04 to maintain max compatibility: https://github.com/golang/go/issues/57328 | |
runs-on: ubuntu-20.04-32 | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- uses: ./.github/actions/vm-release | |
with: | |
vm-name: morpheusvm | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
# VMWithContracts | |
vmwithcontracts-lint: | |
needs: [hypersdk-tests] | |
if: ${{ needs.hypersdk-tests.outputs.only_contracts_changed != 'true' }} | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: ./.github/actions/install-go | |
with: | |
cache-dependency-path: | | |
go.sum | |
examples/vmwithcontracts/go.sum | |
- name: Run static analysis tests | |
working-directory: ./examples/vmwithcontracts | |
shell: bash | |
run: scripts/lint.sh | |
- name: Build vm, cli | |
working-directory: ./examples/vmwithcontracts | |
shell: bash | |
run: | |
scripts/build.sh | |
# vmwithcontracts-unit-tests: | |
# needs: [ hypersdk-tests ] | |
# if: ${{ needs.hypersdk-tests.outputs.only_contracts_changed != 'true' }} | |
# runs-on: ubuntu-20.04-32 | |
# timeout-minutes: 10 | |
# steps: | |
# - name: Checkout | |
# uses: actions/checkout@v4 | |
# - name: Set up Go | |
# uses: ./.github/actions/install-go | |
# with: | |
# cache-dependency-path: | | |
# go.sum | |
# examples/vmwithcontracts/go.sum | |
# - name: Run unit tests | |
# working-directory: ./examples/vmwithcontracts | |
# shell: bash | |
# run: scripts/tests.unit.sh | |
# - name: Run integration tests | |
# working-directory: ./examples/vmwithcontracts | |
# shell: bash | |
# run: scripts/tests.integration.sh | |
# | |
# vmwithcontracts-e2e-tests: | |
# needs: [ vmwithcontracts-lint, vmwithcontracts-unit-tests ] | |
# runs-on: ubuntu-20.04-32 | |
# timeout-minutes: 25 | |
# steps: | |
# - name: Checkout | |
# uses: actions/checkout@v4 | |
# - name: Set up Go | |
# uses: ./.github/actions/install-go | |
# with: | |
# cache-dependency-path: | | |
# go.sum | |
# examples/vmwithcontracts/go.sum | |
# - name: Run e2e tests | |
# working-directory: ./examples/vmwithcontracts | |
# shell: bash | |
# run: scripts/run.sh | |
# env: | |
# MODE: 'test' | |
# - name: Upload tmpnet network dir | |
# uses: ava-labs/avalanchego/.github/actions/upload-tmpnet-artifact@v1-actions | |
# if: always() | |
# with: | |
# name: vmwithcontracts-e2e-tmpnet-data | |
# | |
# vmwithcontracts-release: | |
# needs: [ vmwithcontracts-e2e-tests ] | |
# # We build with 20.04 to maintain max compatibility: https://github.com/golang/go/issues/57328 | |
# runs-on: ubuntu-20.04-32 | |
# permissions: | |
# contents: write | |
# steps: | |
# - name: Checkout | |
# uses: actions/checkout@v4 | |
# - uses: ./.github/actions/vm-release | |
# with: | |
# vm-name: vmwithcontracts | |
# github-token: ${{ secrets.GITHUB_TOKEN }} |