Merge pull request #17 from valory-xyz/chore/update-docs #51
This file contains hidden or 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: open-ACN sanity checks and tests | |
| on: | |
| push: | |
| branches: | |
| - develop | |
| - main | |
| pull_request: | |
| jobs: | |
| common_checks_1: | |
| continue-on-error: False | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - uses: actions/checkout@master | |
| - uses: actions/setup-go@v3 | |
| with: | |
| go-version: "1.17.7" | |
| - name: Install dependencies (ubuntu-latest) | |
| run: | | |
| sudo apt-get update --fix-missing | |
| sudo apt-get autoremove | |
| sudo apt-get autoclean | |
| - name: Golang code style check (libp2p_node) | |
| uses: golangci/golangci-lint-action@v3.1.0 | |
| env: | |
| ACTIONS_ALLOW_UNSECURE_COMMANDS: true | |
| with: | |
| version: v1.45.2 | |
| working-directory: ./ | |
| golang_checks: | |
| continue-on-error: True | |
| needs: | |
| - common_checks_1 | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| python-version: [3.6] | |
| timeout-minutes: 45 | |
| steps: | |
| - uses: actions/checkout@master | |
| - uses: actions/setup-go@v3 | |
| with: | |
| go-version: "1.17.7" | |
| - if: matrix.os == 'macos-latest' | |
| working-directory: . | |
| run: | | |
| export LINKPATH=`go env GOTOOLDIR`/link | |
| echo $LINKPATH | |
| sudo cp $LINKPATH ${LINKPATH}_orig | |
| sudo cp link $LINKPATH | |
| sudo chmod a+x $LINKPATH | |
| - if: matrix.python-version == '3.6' | |
| name: Golang unit tests (libp2p_node) | |
| working-directory: ./ | |
| run: make test | |
| libp2p_coverage: | |
| name: libp2p_coverage | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Set up Go 1.17.7 | |
| uses: actions/setup-go@v1 | |
| with: | |
| go-version: "1.17.7" | |
| id: go | |
| - name: Check out code into the Go module directory | |
| uses: actions/checkout@v1 | |
| - name: Install dependencies (ubuntu-latest) | |
| run: | | |
| sudo apt-get update --fix-missing | |
| sudo apt-get autoremove | |
| sudo apt-get autoclean | |
| sudo apt-get install make -y | |
| - name: Get dependencies | |
| working-directory: ./ | |
| run: | | |
| make install | |
| - name: Generate coverage report | |
| working-directory: ./ | |
| run: | | |
| make test | |
| - name: Print coverage report | |
| working-directory: ./ | |
| run: | | |
| go tool cover -func=coverage.txt | |
| docker: | |
| needs: | |
| - libp2p_coverage | |
| runs-on: ubuntu-latest | |
| if: | |
| contains('refs/heads/main', github.ref) | |
| env: | |
| BRANCH_NAME: ${{ github.head_ref || github.ref_name }} | |
| steps: | |
| - name: Confirm Image | |
| run: echo "Building image for ${{env.BRANCH_NAME}}" | |
| - name: Checkout | |
| uses: actions/checkout@v2 | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v1 | |
| - name: Declare Env Vars | |
| id: vars | |
| shell: bash | |
| run: | | |
| echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" | |
| echo "::set-output name=sha_short::$(git rev-parse --short HEAD)" | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v1 | |
| - name: Login to DockerHub | |
| uses: docker/login-action@v1 | |
| with: | |
| username: valory | |
| password: ${{ secrets.ACCESS_TOKEN }} | |
| - name: Build and push | |
| uses: docker/build-push-action@v2 | |
| with: | |
| context: . | |
| push: true | |
| tags: valory/${{ github.event.repository.name }}:${{ steps.vars.outputs.sha_short }} |