Skip to content

Commit

Permalink
workflows refactoring (#339)
Browse files Browse the repository at this point in the history
* workflows refactoring
# Conflicts:
#	.github/CODEOWNERS
#	.github/workflows/build-deb-pkg.sh
#	.github/workflows/build-tgz-pkg.sh
#	.github/workflows/build_artifacts.yml
#	.github/workflows/ci.yml
#	.github/workflows/fuzz_merkledb.yml
#	.github/workflows/publish_image.sh
#	.github/workflows/run-net-outage-sim.sh
#	scripts/build.sh
#	scripts/build_avalanche.sh
#	scripts/build_testnetctl.sh
#	scripts/tests.e2e.sh
#	scripts/tests.upgrade.sh
#	tests/e2e/README.md
#	tests/fixture/e2e/flags.go
#	tests/fixture/tmpnet/README.md
#	tests/fixture/tmpnet/cmd/main.go
  • Loading branch information
evlekht committed Jul 21, 2024
1 parent 21b0620 commit 2744d73
Show file tree
Hide file tree
Showing 83 changed files with 470 additions and 1,417 deletions.
22 changes: 1 addition & 21 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,23 +1,3 @@
# https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners#codeowners-syntax

* @StephenButtolph
/app/ @danlaine
/codec/ @danlaine
/database/corruptabledb/ @ceyonur
/ids/ @danlaine @joshua-kim
/indexer/ @danlaine
/message/ @gyuho
/network/ @danlaine @joshua-kim @StephenButtolph
/network/throttling/ @danlaine @dboehm-avalabs @StephenButtolph
/proto/ @gyuho @hexfusion
/snow/ @danlaine @StephenButtolph
/snow/consensus/ @gyuho @StephenButtolph
/snow/engine/snowman/syncer/ @abi87
/snow/uptime/ @ceyonur
/utils/logging/ @ceyonur
/vms/platformvm/ @abi87 @danlaine @StephenButtolph
/vms/proposervm/ @abi87 @StephenButtolph
/vms/rpcchainvm/ @hexfusion @StephenButtolph
/vms/registry/ @joshua-kim
/tests/ @abi87 @gyuho @marun
/x/ @danlaine @darioush @dboehm-avalabs
* @evlekht
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ A clear and concise description of what you expected to happen.
If applicable, add screenshots to help explain your problem.

**Logs**
If applicable, please include the relevant logs that indicate a problem and/or the log directory of your node. By default, this can be found at `~/.avalanchego/logs/`.
If applicable, please include the relevant logs that indicate a problem and/or the log directory of your node. By default, this can be found at `~/.caminogo/logs/`.

**Metrics**
If applicable, please include any metrics gathered from your node to assist us in diagnosing the problem.
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_spec.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: Feature specification
about: Discussion on design and implementation of new features for avalanchego.
about: Discussion on design and implementation of new features for caminogo.
title: ''
labels: enhancement
assignees: ''
Expand Down
17 changes: 17 additions & 0 deletions .github/workflows/buf-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: buf-push

on:
workflow_dispatch:

jobs:
push:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: bufbuild/buf-setup-action@v1.34.0
with:
github_token: ${{ github.token }}
- uses: bufbuild/buf-push-action@v1
with:
input: "proto"
buf_token: ${{ secrets.BUF_TOKEN }}
26 changes: 13 additions & 13 deletions .github/workflows/build-deb-pkg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,35 @@
set -euo pipefail

DEBIAN_BASE_DIR=$PKG_ROOT/debian
AVALANCHE_BUILD_BIN_DIR=$DEBIAN_BASE_DIR/usr/local/bin
TEMPLATE=.github/workflows/debian/template
CAMINO_BUILD_BIN_DIR=$DEBIAN_BASE_DIR/usr/local/bin
TEMPLATE=.github/workflows/debian/template
DEBIAN_CONF=$DEBIAN_BASE_DIR/DEBIAN

mkdir -p $DEBIAN_BASE_DIR
mkdir -p $DEBIAN_CONF
mkdir -p $AVALANCHE_BUILD_BIN_DIR
mkdir -p "$DEBIAN_BASE_DIR"
mkdir -p "$DEBIAN_CONF"
mkdir -p "$CAMINO_BUILD_BIN_DIR"

# Assume binaries are at default locations
OK=`cp ./build/avalanchego $AVALANCHE_BUILD_BIN_DIR`
OK=$(cp ./build/caminogo "$CAMINO_BUILD_BIN_DIR")
if [[ $OK -ne 0 ]]; then
exit $OK;
exit "$OK";
fi

OK=`cp $TEMPLATE/control $DEBIAN_CONF/control`
OK=$(cp $TEMPLATE/control "$DEBIAN_CONF"/control)
if [[ $OK -ne 0 ]]; then
exit $OK;
exit "$OK";
fi

echo "Build debian package..."
cd $PKG_ROOT
cd "$PKG_ROOT"
echo "Tag: $TAG"
VER=$TAG
if [[ $TAG =~ ^v ]]; then
VER=$(echo $TAG | tr -d 'v')
VER=$(echo "$TAG" | tr -d 'v')
fi
NEW_VERSION_STRING="Version: $VER"
NEW_ARCH_STRING="Architecture: $ARCH"
sed -i "s/Version.*/$NEW_VERSION_STRING/g" debian/DEBIAN/control
sed -i "s/Architecture.*/$NEW_ARCH_STRING/g" debian/DEBIAN/control
dpkg-deb --build debian avalanchego-$TAG-$ARCH.deb
aws s3 cp avalanchego-$TAG-$ARCH.deb s3://${BUCKET}/linux/debs/ubuntu/$RELEASE/$ARCH/
dpkg-deb --build debian "caminogo-$TAG-$ARCH.deb"
#gsutil cp "caminogogo-$TAG-$ARCH.deb" "gs://$BUCKET/linux/debs/ubuntu/$RELEASE/$ARCH/"
20 changes: 0 additions & 20 deletions .github/workflows/build-docker.yml

This file was deleted.

14 changes: 7 additions & 7 deletions .github/workflows/build-tgz-pkg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@

set -euo pipefail

AVALANCHE_ROOT=$PKG_ROOT/avalanchego-$TAG
CAMINO_ROOT=$PKG_ROOT/caminogo-$TAG

mkdir -p $AVALANCHE_ROOT
mkdir -p "$CAMINO_ROOT"

OK=`cp ./build/avalanchego $AVALANCHE_ROOT`
OK=$(cp ./build/caminogo "$CAMINO_ROOT")
if [[ $OK -ne 0 ]]; then
exit $OK;
exit "$OK";
fi


echo "Build tgz package..."
cd $PKG_ROOT
cd "$PKG_ROOT"
echo "Tag: $TAG"
tar -czvf "avalanchego-linux-$ARCH-$TAG.tar.gz" avalanchego-$TAG
aws s3 cp avalanchego-linux-$ARCH-$TAG.tar.gz s3://$BUCKET/linux/binaries/ubuntu/$RELEASE/$ARCH/
tar -czvf "caminogo-linux-$ARCH-$TAG.tar.gz" "caminogo-$TAG"
#gsutil cp "caminogo-linux-$ARCH-$TAG.tar.gz" "gs://$BUCKET/linux/binaries/ubuntu/$RELEASE/$ARCH/"
27 changes: 0 additions & 27 deletions .github/workflows/build_artifacts.yml

This file was deleted.

199 changes: 199 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,199 @@
name: Tests

on:
pull_request:
branches: [chain4travel, dev]
workflow_dispatch:
merge_group:
types: [checks_requested]

permissions:
contents: read

# Cancel ongoing workflow runs if a new one is started
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
go_version: '~1.20.12'
tmpnet_data_path: ~/.tmpnet/networks/1003

jobs:
Unit:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# os: [macos-12, ubuntu-20.04, ubuntu-22.04, windows-2022, [self-hosted, linux, ARM64, focal], [self-hosted, linux, ARM64, jammy]]
os: [ubuntu-22.04]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ env.go_version }}
check-latest: true
- name: Set timeout on Windows # Windows UT run slower and need a longer timeout
shell: bash
if: matrix.os == 'windows-2022'
run: echo "TIMEOUT=240s" >> $GITHUB_ENV
- name: build_test
shell: bash
run: ./scripts/build_test.sh
env:
TIMEOUT: ${{ env.TIMEOUT }}
Fuzz:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ env.go_version }}
check-latest: true
- name: fuzz_test
shell: bash
run: ./scripts/build_fuzz.sh 10 # Run each fuzz test 10 seconds
e2e:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-go@v5
with:
go-version: ${{ env.go_version }}
check-latest: true
- name: Build the caminogo binaries
shell: bash
run: ./scripts/build.sh -r
- name: Run e2e tests
shell: bash
run: E2E_SERIAL=1 ./scripts/tests.e2e.sh
- name: Upload tmpnet network dir
uses: actions/upload-artifact@v4
if: always()
with:
name: e2e-tmpnet-data
path: ${{ env.tmpnet_data_path }}
if-no-files-found: error
e2e_existing_network:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-go@v5
with:
go-version: ${{ env.go_version }}
check-latest: true
- name: Build caminogo binaries
shell: bash
run: ./scripts/build.sh -r
- name: Run e2e tests with existing network
shell: bash
run: E2E_SERIAL=1 ./scripts/tests.e2e.existing.sh
- name: Upload tmpnet network dir
uses: actions/upload-artifact@v4
if: always()
with:
name: e2e-existing-network-tmpnet-data
path: ${{ env.tmpnet_data_path }}
if-no-files-found: error
Upgrade:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ env.go_version }}
check-latest: true
- name: Build CaminoGo Binary
shell: bash
run: ./scripts/build.sh
- name: Run e2e tests
shell: bash
run: ./scripts/tests.upgrade.sh
- name: Upload tmpnet network dir
uses: actions/upload-artifact@v4
if: always()
with:
name: upgrade-tmpnet-data
path: ${{ env.tmpnet_data_path }}
if-no-files-found: error
Lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ env.go_version }}
check-latest: true
- name: Run static analysis tests
shell: bash
run: scripts/lint.sh
- name: Run shellcheck
shell: bash
run: scripts/shellcheck.sh
buf-lint:
name: Protobuf Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: bufbuild/buf-setup-action@v1.34.0
with:
github_token: ${{ github.token }}
- uses: bufbuild/buf-lint-action@v1
with:
input: "proto"
check_generated_protobuf:
name: Up-to-date protobuf
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ env.go_version }}
check-latest: true
- uses: bufbuild/buf-setup-action@v1.34.0
with:
github_token: ${{ github.token }}
- shell: bash
run: scripts/protobuf_codegen.sh
- shell: bash
run: .github/workflows/check-clean-branch.sh
check_mockgen:
name: Up-to-date mocks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ env.go_version }}
check-latest: true
- shell: bash
run: scripts/mock.gen.sh
- shell: bash
run: .github/workflows/check-clean-branch.sh
go_mod_tidy:
name: Up-to-date go.mod and go.sum
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ env.go_version }}
check-latest: true
- shell: bash
run: go mod tidy
- shell: bash
run: .github/workflows/check-clean-branch.sh
build_docker_image:
name: Test docker image building
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Build docker image
run: scripts/build_image.sh

File renamed without changes.
Loading

0 comments on commit 2744d73

Please sign in to comment.