github.com/MetalBlockchain/subnet-evm@v0.4.9/.github/workflows/lint-tests-release.yml (about)

     1  name: Build + test + release
     2  
     3  on:
     4    push:
     5      branches:
     6        - master
     7      tags:
     8        - "*"
     9    pull_request:
    10  
    11  jobs:
    12    lint_test:
    13      name: Lint
    14      runs-on: ubuntu-20.04
    15      steps:
    16        - uses: actions/checkout@v3
    17        - run: ./scripts/lint_allowed_geth_imports.sh
    18          shell: bash
    19        - name: golangci-lint
    20          uses: golangci/golangci-lint-action@v2
    21          with:
    22            version: v1.47
    23            working-directory: .
    24            args: --timeout 3m
    25  
    26    unit_test:
    27      name: Golang Unit Tests v${{ matrix.go }} (${{ matrix.os }})
    28      runs-on: ${{ matrix.os }}
    29      strategy:
    30        matrix:
    31          go: ["1.18"]
    32          os: [ubuntu-20.04]
    33      steps:
    34        - uses: actions/checkout@v3
    35        - uses: actions/setup-go@v3
    36          with:
    37            go-version: ${{ matrix.go }}
    38        - run: go mod download
    39          shell: bash
    40        - run: ./scripts/build.sh ./build/subnetevm
    41          shell: bash
    42        - run: ./scripts/build_test.sh -race
    43          shell: bash
    44        - run: ./scripts/coverage.sh
    45          shell: bash
    46  
    47    e2e_test:
    48      name: e2e tests
    49      runs-on: ubuntu-latest
    50      steps:
    51        - name: Git checkout
    52          uses: actions/checkout@v3
    53          with:
    54            fetch-depth: 0
    55        - name: Set up Go
    56          uses: actions/setup-go@v3
    57          with:
    58            go-version: 1.18
    59        - name: Use Node.js
    60          uses: actions/setup-node@v3
    61          with:
    62            node-version: "14.x"
    63        - name: Yarn install
    64          run: yarn
    65          working-directory: ./contract-examples
    66        - name: Install MetalGo Release
    67          shell: bash
    68          run: BASEDIR=/tmp/e2e-test METALGO_BUILD_PATH=/tmp/e2e-test/metalgo ./scripts/install_metalgo_release.sh
    69        - name: Build Subnet-EVM Plugin Binary
    70          shell: bash
    71          run: ./scripts/build.sh /tmp/e2e-test/metalgo/plugins/srEXiWaHuhNyGwPUi444Tu47ZEDwxTWrbQiuD7FmgSAQ6X7Dy
    72        - name: Run E2E Tests
    73          shell: bash
    74          run: METALGO_BUILD_PATH=/tmp/e2e-test/metalgo DATA_DIR=/tmp/e2e-test/data ./scripts/run_ginkgo.sh
    75  
    76    release:
    77      # needs: [lint_test, unit_test, e2e_test, simulator_test]
    78      runs-on: ubuntu-20.04
    79      steps:
    80        - name: Git checkout
    81          uses: actions/checkout@v3
    82          with:
    83            fetch-depth: 0
    84            path: subnet-evm
    85        - name: Set up Go
    86          uses: actions/setup-go@v3
    87          with:
    88            go-version: 1.18
    89        - name: Set up arm64 cross compiler
    90          run: |
    91            sudo apt-get -y update
    92            sudo apt-get -y install gcc-aarch64-linux-gnu
    93        - name: Checkout osxcross
    94          uses: actions/checkout@v2
    95          with:
    96            repository: tpoechtrager/osxcross
    97            path: osxcross
    98        - name: Build osxcross
    99          run: |
   100            sudo apt-get -y install clang llvm-dev libxml2-dev uuid-dev libssl-dev bash patch make tar xz-utils bzip2 gzip sed cpio libbz2-dev
   101            cd osxcross
   102            wget https://github.com/phracker/MacOSX-SDKs/releases/download/11.3/MacOSX11.3.sdk.tar.xz -O tarballs/MacOSX11.3.sdk.tar.xz
   103            echo cd4f08a75577145b8f05245a2975f7c81401d75e9535dcffbb879ee1deefcbf4 tarballs/MacOSX11.3.sdk.tar.xz | sha256sum -c -
   104            UNATTENDED=1 ./build.sh
   105            echo $PWD/target/bin >> $GITHUB_PATH
   106        - name: Run GoReleaser
   107          uses: goreleaser/goreleaser-action@v2
   108          with:
   109            distribution: goreleaser
   110            version: latest
   111            args: release --rm-dist
   112            workdir: ./subnet-evm/
   113          env:
   114            # https://docs.github.com/en/actions/security-guides/automatic-token-authentication#about-the-github_token-secret
   115            GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}