Skip to content

Commit

Permalink
workflows refactoring (#339)
Browse files Browse the repository at this point in the history
* workflows refactoring
  • Loading branch information
mo-c4t committed Jul 11, 2024
1 parent a54f286 commit 93b4900
Show file tree
Hide file tree
Showing 86 changed files with 242 additions and 1,424 deletions.
21 changes: 1 addition & 20 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,22 +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
/snow/ @danlaine @StephenButtolph
/snow/consensus/ @gyuho @StephenButtolph
/snow/engine/snowman/syncer/ @abi87
/snow/uptime/ @ceyonur
/utils/logging/ @ceyonur
/vms/platformvm/ @abi87 @danlaine @dhrubabasu @StephenButtolph
/vms/proposervm/ @abi87 @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 }}
10 changes: 5 additions & 5 deletions .github/workflows/build-deb-pkg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
set -euo pipefail

DEBIAN_BASE_DIR=$PKG_ROOT/debian
AVALANCHE_BUILD_BIN_DIR=$DEBIAN_BASE_DIR/usr/local/bin
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 "$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";
fi
Expand All @@ -33,5 +33,5 @@ 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.

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

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";
fi
Expand All @@ -15,5 +15,5 @@ fi
echo "Build tgz package..."
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.

96 changes: 47 additions & 49 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ name: Tests

on:
pull_request:
tags-ignore: ["*"]
branches: [chain4travel, dev]
push:
branches: [chain4travel, dev]
workflow_dispatch:
merge_group:
Expand All @@ -31,8 +28,8 @@ jobs:
# 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@v3
- uses: actions/setup-go@v3
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ env.go_version }}
check-latest: true
Expand All @@ -48,8 +45,8 @@ jobs:
Fuzz:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ env.go_version }}
check-latest: true
Expand All @@ -59,10 +56,10 @@ jobs:
e2e:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-go@v3
- uses: actions/setup-go@v5
with:
go-version: ${{ env.go_version }}
check-latest: true
Expand All @@ -73,7 +70,7 @@ jobs:
shell: bash
run: E2E_SERIAL=1 ./scripts/tests.e2e.sh
- name: Upload tmpnet network dir
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: always()
with:
name: e2e-tmpnet-data
Expand All @@ -82,10 +79,10 @@ jobs:
e2e_existing_network:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-go@v3
- uses: actions/setup-go@v5
with:
go-version: ${{ env.go_version }}
check-latest: true
Expand All @@ -96,39 +93,38 @@ jobs:
shell: bash
run: E2E_SERIAL=1 ./scripts/tests.e2e.existing.sh
- name: Upload tmpnet network dir
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: always()
with:
name: e2e-existing-network-tmpnet-data
path: ${{ env.tmpnet_data_path }}
if-no-files-found: error
# TODO: re-activate this test after there is a compatible tag to use
# Upgrade:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - uses: actions/setup-go@v3
# with:
# go-version: ${{ env.go_version }}
# check-latest: true
# - name: Build caminogo binaries
# 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@v3
# if: always()
# with:
# name: upgrade-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@v3
- uses: actions/setup-go@v3
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ env.go_version }}
check-latest: true
Expand All @@ -142,23 +138,25 @@ jobs:
name: Protobuf Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: bufbuild/buf-setup-action@v1.26.1
- uses: actions/checkout@v4
- uses: bufbuild/buf-setup-action@v1.34.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
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@v3
- uses: actions/setup-go@v3
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ env.go_version }}
check-latest: true
- uses: bufbuild/buf-setup-action@v1.26.1
- uses: bufbuild/buf-setup-action@v1.34.0
with:
github_token: ${{ github.token }}
- shell: bash
run: scripts/protobuf_codegen.sh
- shell: bash
Expand All @@ -167,8 +165,8 @@ jobs:
name: Up-to-date mocks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ env.go_version }}
check-latest: true
Expand All @@ -180,8 +178,8 @@ jobs:
name: Up-to-date go.mod and go.sum
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ env.go_version }}
check-latest: true
Expand All @@ -193,9 +191,9 @@ jobs:
name: Test docker image building
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Build docker image
run: scripts/build_local_image.sh
run: scripts/build_image.sh

File renamed without changes.
12 changes: 5 additions & 7 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,9 @@
name: "CodeQL"

on:
push:
branches: [chain4travel, dev]
pull_request:
tags-ignore: ["*"]
branches: [chain4travel, dev]
workflow_dispatch:
merge_group:
types: [checks_requested]

Expand All @@ -38,11 +36,11 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -53,7 +51,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2
uses: github/codeql-action/autobuild@v3

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
Expand All @@ -67,4 +65,4 @@ jobs:
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
Loading

0 comments on commit 93b4900

Please sign in to comment.