Skip to content

Merge pull request #29 from valory-xyz/chore/bump-x-crypto-x-net #82

Merge pull request #29 from valory-xyz/chore/bump-x-crypto-x-net

Merge pull request #29 from valory-xyz/chore/bump-x-crypto-x-net #82

Workflow file for this run

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@v4
- uses: actions/setup-go@v5
with:
go-version: "1.25.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@v9
with:
version: v2.12.2
args: --timeout=5m
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]
timeout-minutes: 45
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.25.7"
- 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.24.0
uses: actions/setup-go@v5
with:
go-version: "1.25.7"
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v4
- 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 }}
# Disable the build summary emitted by docker/build-push-action@v6.
# The summary embeds commit metadata in a blob that the GHA runner
# rescans for legacy workflow commands; any commit message that
# happens to contain literal text like "::set-output" (e.g. when
# describing a migration away from that deprecated syntax) then
# triggers a spurious ##[error] and fails the step *after* the
# image has already been built and pushed.
DOCKER_BUILD_SUMMARY: "false"
DOCKER_BUILD_RECORD_UPLOAD: "false"
steps:
- name: Confirm Image
run: echo "Building image for ${{env.BRANCH_NAME}}"
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Declare Env Vars
id: vars
shell: bash
run: |
echo "branch=${GITHUB_REF#refs/heads/}" >> "$GITHUB_OUTPUT"
echo "sha_short=$(git rev-parse --short HEAD)" >> "$GITHUB_OUTPUT"
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
push: true
# Publish both the commit-pinned tag (for reproducible pins in
# downstream repos) and a ``:latest`` alias tracking main, so
# consumers that just want "the current image" don't have to
# bump a SHA on every ACN release.
tags: |
valory/${{ github.event.repository.name }}:${{ steps.vars.outputs.sha_short }}
valory/${{ github.event.repository.name }}:latest
all_checks_passed:
name: All checks passed
if: always()
needs:
- common_checks_1
- golang_checks
- libp2p_coverage
runs-on: ubuntu-latest
steps:
- name: Verify all dependencies succeeded
if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
run: exit 1
- run: echo "All required checks passed."