Skip to content

Commit

Permalink
Cleanup CI (#2480)
Browse files Browse the repository at this point in the history
Co-authored-by: Stephen Buttolph <[email protected]>
  • Loading branch information
dhrubabasu and StephenButtolph authored Dec 13, 2023
1 parent 832632a commit 1461137
Show file tree
Hide file tree
Showing 11 changed files with 195 additions and 276 deletions.
53 changes: 0 additions & 53 deletions .github/workflows/auto-generated-checker.yml

This file was deleted.

27 changes: 0 additions & 27 deletions .github/workflows/buf-lint.yml

This file was deleted.

7 changes: 5 additions & 2 deletions .github/workflows/build-linux-binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ on:
tags:
- "*"

env:
go_version: '~1.20.12'

jobs:
build-x86_64-binaries-tarball:
runs-on: ubuntu-20.04
Expand All @@ -19,7 +22,7 @@ jobs:

- uses: actions/setup-go@v3
with:
go-version: '~1.20.12'
go-version: ${{ env.go_version }}
check-latest: true

- run: go version
Expand Down Expand Up @@ -81,7 +84,7 @@ jobs:

- uses: actions/setup-go@v3
with:
go-version: '~1.20.12'
go-version: ${{ env.go_version }}
check-latest: true

- run: go version
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/build-ubuntu-amd64-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ on:
tags:
- "*"

env:
go_version: '~1.20.12'

jobs:
build-jammy-amd64-package:
runs-on: ubuntu-22.04
Expand All @@ -18,7 +21,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: '~1.20.12'
go-version: ${{ env.go_version }}
check-latest: true
- run: go version

Expand Down Expand Up @@ -78,7 +81,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: '~1.20.12'
go-version: ${{ env.go_version }}
check-latest: true
- run: go version

Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/build-ubuntu-arm64-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ on:
tags:
- "*"

env:
go_version: '~1.20.12'

jobs:
build-jammy-arm64-package:
runs-on: [self-hosted, linux, ARM64, jammy]
Expand All @@ -18,7 +21,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: '~1.20.12'
go-version: ${{ env.go_version }}
check-latest: true
- run: go version

Expand Down Expand Up @@ -78,7 +81,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: '~1.20.12'
go-version: ${{ env.go_version }}
check-latest: true
- run: go version

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

on:
push:
tags:
- "*"
branches:
- master
- dev
pull_request:
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'

jobs:
Unit:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-12, ubuntu-20.04, ubuntu-22.04, windows-2022, [self-hosted, linux, ARM64, focal], [self-hosted, linux, ARM64, jammy]]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
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@v3
- uses: actions/setup-go@v3
with:
go-version: ${{ env.go_version }}
check-latest: true
- name: fuzz_test
shell: bash
run: ./scripts/build_fuzz.sh 15 # Run each fuzz test 15 seconds
e2e:
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 AvalancheGo Binary
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@v3
if: always()
with:
name: e2e-artifact
path: ~/.tmpnet/networks/1000
e2e_existing_network:
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 AvalancheGo Binary
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@v3
if: always()
with:
name: e2e-existing-network-tmpnet-artifact
path: ~/.tmpnet/networks/1000
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 AvalancheGo Binary
shell: bash
run: ./scripts/build.sh
- name: Run e2e tests
shell: bash
# 1.10.7 is the first version compatible with the ephnet fixture by
# virtue of writing a process context file on node start.
run: ./scripts/tests.upgrade.sh 1.10.7
- name: Upload ephnet network dir
uses: actions/upload-artifact@v3
if: always()
with:
name: upgrade-artifact
path: ~/.ephnet/networks/1000
Lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: ${{ env.go_version }}
check-latest: true
- name: Run static analysis tests
shell: bash
run: scripts/lint.sh
buf-lint:
name: Protobuf Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: bufbuild/[email protected]
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@v3
- uses: actions/setup-go@v3
with:
go-version: ${{ env.go_version }}
check-latest: true
- uses: bufbuild/[email protected]
- 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@v3
- uses: actions/setup-go@v3
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@v3
- uses: actions/setup-go@v3
with:
go-version: ${{ env.go_version }}
check-latest: true
- shell: bash
run: go mod tidy
- shell: bash
run: .github/workflows/check-clean-branch.sh
27 changes: 0 additions & 27 deletions .github/workflows/static-analysis.yml

This file was deleted.

Loading

0 comments on commit 1461137

Please sign in to comment.