Skip to content

Move CI tasks to Taskfile.yml #1610

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 20 commits into from
Jul 4, 2025
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
dabb987
Move CI tasks to Takefile.yml
JonathanOppenheimer Jun 26, 2025
d5df1ed
Force bash shell on Windows tests
JonathanOppenheimer Jun 26, 2025
01ae4a2
Instead, set shell to bash for all tasks
JonathanOppenheimer Jun 26, 2025
2bbfcff
Move bash shell directly to the tests, rather than run task
JonathanOppenheimer Jun 26, 2025
4bde723
Change to direct bash calls in the taskfile
JonathanOppenheimer Jun 26, 2025
db65042
Remove logs folder
JonathanOppenheimer Jun 26, 2025
40e7d07
Remove Windows tests, consolidate tests
JonathanOppenheimer Jun 27, 2025
11cd2c0
remove runtime import
JonathanOppenheimer Jun 27, 2025
42415e3
revert windows change, fix env
JonathanOppenheimer Jun 27, 2025
7b58e10
warp environment
JonathanOppenheimer Jun 27, 2025
af47f57
fix antithesis order from consolidtion
JonathanOppenheimer Jun 27, 2025
b116e28
Clarify default env vars
JonathanOppenheimer Jun 30, 2025
a1ed580
Consolidate testing further into tasks
JonathanOppenheimer Jul 1, 2025
f5f008b
Restore run_env to comply with written test
JonathanOppenheimer Jul 1, 2025
eb7130a
restore env variables for avalanchego release
JonathanOppenheimer Jul 1, 2025
72fe798
Add more verbose task descriptions, and move contract commands to a task
JonathanOppenheimer Jul 1, 2025
a2e21b5
make env explicitly clear for precompiles
JonathanOppenheimer Jul 1, 2025
8f671f1
globalize environment variables
JonathanOppenheimer Jul 1, 2025
7ce3b10
Further consolidate tasks and move from .sh
JonathanOppenheimer Jul 3, 2025
c4777b2
Merge branch 'master' into move-ci-tasks
ceyonur Jul 3, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 4 additions & 26 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,12 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-22.04, ubuntu-latest, windows-latest]
os: [macos-latest, ubuntu-22.04, ubuntu-latest]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: "go.mod"
- name: Set timeout on Windows # Windows UT run slower and need a longer timeout
shell: bash
if: matrix.os == 'windows-latest'
run: echo "TIMEOUT=1200s" >> "$GITHUB_ENV"
- run: go mod download
shell: bash
- name: fjl/gencodec generated files are up to date
Expand Down Expand Up @@ -144,16 +140,10 @@ jobs:
- name: Hardhat Compile
run: npx hardhat compile
working-directory: ./contracts
- name: Install AvalancheGo Release
shell: bash
run: ./scripts/run_task.sh install-avalanchego-release
- name: Build Subnet-EVM Plugin Binary
shell: bash
run: ./scripts/run_task.sh build
- name: Run Warp E2E Tests
uses: ava-labs/avalanchego/.github/actions/run-monitored-tmpnet-cmd@092cf182dd92b66a8ab882b657d3ae52b174c913
with:
run: ./scripts/run_task.sh test-e2e-warp
run: ./scripts/run_task.sh test-e2e-warp-ci
run_env: AVALANCHEGO_BUILD_PATH=/tmp/e2e-test/avalanchego
artifact_prefix: warp
prometheus_username: ${{ secrets.PROMETHEUS_ID || '' }}
Expand All @@ -172,16 +162,10 @@ jobs:
uses: actions/setup-go@v5
with:
go-version-file: "go.mod"
- name: Install AvalancheGo Release
shell: bash
run: ./scripts/run_task.sh install-avalanchego-release
- name: Build Subnet-EVM Plugin Binary
shell: bash
run: ./scripts/run_task.sh build
- name: Run E2E Load Tests
uses: ava-labs/avalanchego/.github/actions/run-monitored-tmpnet-cmd@092cf182dd92b66a8ab882b657d3ae52b174c913
with:
run: ./scripts/run_task.sh test-e2e-load
run: ./scripts/run_task.sh test-e2e-load-ci
run_env: AVALANCHEGO_BUILD_PATH=/tmp/e2e-test/avalanchego
artifact_prefix: load
prometheus_username: ${{ secrets.PROMETHEUS_ID || '' }}
Expand All @@ -208,15 +192,9 @@ jobs:
- uses: actions/setup-go@v5
with:
go-version-file: "go.mod"
- name: Install AvalancheGo Release
shell: bash
run: ./scripts/run_task.sh install-avalanchego-release
- name: Build Subnet-EVM Plugin Binary
shell: bash
run: ./scripts/run_task.sh build
- name: Check that the antithesis workload is sane
shell: bash
run: go run ./tests/antithesis --avalanchego-path=/tmp/e2e-test/avalanchego/avalanchego --duration=60s
- name: Check antithesis image build
shell: bash
run: ./scripts/run_task.sh test-build-antithesis-images
run: ./scripts/run_task.sh test-build-antithesis-images-ci
49 changes: 33 additions & 16 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,46 +9,46 @@ tasks:

actionlint:
desc: Run the actionlint.sh
cmd: bash ./scripts/actionlint.sh # tests.yml
cmd: ./scripts/actionlint.sh # tests.yml

build:
desc: Run the build.sh
cmd: bash ./scripts/build.sh # tests.yml
cmd: ./scripts/build.sh # tests.yml

build-antithesis-images-avalanchego:
desc: Build the antithesis images for the avalanchego test setup
cmd: bash -x ./scripts/build_antithesis_images.sh # publish_antithesis_images.yml

build-bench-precompiles:
desc: Build the benchmark precompiles
cmd: bash ./scripts/build_bench_precompiles.sh # bench.yml
cmd: ./scripts/build_bench_precompiles.sh # bench.yml

build-docker-image:
desc: Build the docker image
cmd: bash ./scripts/build_docker_image.sh # publish_docker.yml
cmd: ./scripts/build_docker_image.sh # publish_docker.yml

build-test:
desc: Run the build_test.sh
cmd: bash ./scripts/build_test.sh # tests.yml
cmd: ./scripts/build_test.sh # tests.yml

coverage:
desc: Run the coverage.sh
cmd: bash ./scripts/coverage.sh # tests.yml
cmd: ./scripts/coverage.sh # tests.yml

install-avalanchego-release:
desc: Install AvalancheGo release for testing
env:
BASEDIR: /tmp/e2e-test
AVALANCHEGO_BUILD_PATH: /tmp/e2e-test/avalanchego
cmd: bash ./scripts/install_avalanchego_release.sh # tests.yml
cmd: ./scripts/install_avalanchego_release.sh # tests.yml

lint_allowed_eth_imports:
desc: Run the lint_allowed_eth_imports.sh
cmd: bash ./scripts/lint_allowed_eth_imports.sh # tests.yml
cmd: ./scripts/lint_allowed_eth_imports.sh # tests.yml

shellcheck:
desc: Run the shellcheck.sh
cmd: bash ./scripts/shellcheck.sh # tests.yml
cmd: ./scripts/shellcheck.sh # tests.yml

test-build-antithesis-images:
desc: Test antithesis images build
Expand All @@ -58,11 +58,16 @@ tasks:
desc: Test docker image build
cmd: bash -x scripts/tests.build_docker_image.sh # tests.yml

test-build-antithesis-images-ci: # consolidated test-build-antithesis-images
desc: Test antithesis images build with CI setup
cmds:
- task: install-avalanchego-release
- task: build
- task: test-build-antithesis-images

test-e2e-load:
desc: Run E2E load tests
env:
AVALANCHEGO_BUILD_PATH: /tmp/e2e-test/avalanchego
cmd: bash ./scripts/run_ginkgo_load.sh # tests.yml
cmd: ./scripts/run_ginkgo_load.sh # tests.yml

test-e2e-precompile:
desc: Run E2E precompile tests
Expand All @@ -80,10 +85,22 @@ tasks:

test-e2e-warp:
desc: Run E2E warp tests
env:
AVALANCHEGO_BUILD_PATH: /tmp/e2e-test/avalanchego
cmd: bash ./scripts/run_ginkgo_warp.sh # tests.yml
cmd: ./scripts/run_ginkgo_warp.sh # tests.yml

test-e2e-load-ci: # consolidated test-e2e-load
desc: Run E2E load tests with CI setup
cmds:
- task: install-avalanchego-release
- task: build
- task: test-e2e-load

test-e2e-warp-ci: # consolidated test-e2e-warp
desc: Run E2E warp tests with CI setup
cmds:
- task: install-avalanchego-release
- task: build
- task: test-e2e-warp

update_avalanchego_version:
desc: Run the update_avalanchego_version.sh
cmd: bash ./scripts/update_avalanchego_version.sh # tests.yml
cmd: ./scripts/update_avalanchego_version.sh # tests.yml
15 changes: 4 additions & 11 deletions cmd/utils/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,17 @@ import (
"fmt"
"io"
"os"
"runtime"
)

// Fatalf formats a message to standard error and exits the program.
// The message is also printed to standard output if standard error
// is redirected to a different file.
func Fatalf(format string, args ...interface{}) {
w := io.MultiWriter(os.Stdout, os.Stderr)
if runtime.GOOS == "windows" {
// The SameFile check below doesn't work on Windows.
// stdout is unlikely to get redirected though, so just print there.
w = os.Stdout
} else {
outf, _ := os.Stdout.Stat()
errf, _ := os.Stderr.Stat()
if outf != nil && errf != nil && os.SameFile(outf, errf) {
w = os.Stderr
}
outf, _ := os.Stdout.Stat()
errf, _ := os.Stderr.Stat()
if outf != nil && errf != nil && os.SameFile(outf, errf) {
w = os.Stderr
}
fmt.Fprintf(w, "Fatal: "+format+"\n", args...)
os.Exit(1)
Expand Down
35 changes: 10 additions & 25 deletions internal/flags/flags_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,37 +28,22 @@

import (
"os/user"
"runtime"
"testing"
)

func TestPathExpansion(t *testing.T) {
user, _ := user.Current()
var tests map[string]string

if runtime.GOOS == "windows" {
tests = map[string]string{
`/home/someuser/tmp`: `\home\someuser\tmp`,
`~/tmp`: user.HomeDir + `\tmp`,
`~thisOtherUser/b/`: `~thisOtherUser\b`,
`$DDDXXX/a/b`: `\tmp\a\b`,
`/a/b/`: `\a\b`,
`C:\Documents\Newsletters\`: `C:\Documents\Newsletters`,
`C:\`: `C:\`,
`\\.\pipe\\pipe\geth621383`: `\\.\pipe\\pipe\geth621383`,
}
} else {
tests = map[string]string{
`/home/someuser/tmp`: `/home/someuser/tmp`,
`~/tmp`: user.HomeDir + `/tmp`,
`~thisOtherUser/b/`: `~thisOtherUser/b`,
`$DDDXXX/a/b`: `/tmp/a/b`,
`/a/b/`: `/a/b`,
`C:\Documents\Newsletters\`: `C:\Documents\Newsletters\`,
`C:\`: `C:\`,
`\\.\pipe\\pipe\geth621383`: `\\.\pipe\\pipe\geth621383`,
}
var tests map[string]string = map[string]string{
`/home/someuser/tmp`: `/home/someuser/tmp`,
`~/tmp`: user.HomeDir + `/tmp`,
`~thisOtherUser/b/`: `~thisOtherUser/b`,
`$DDDXXX/a/b`: `/tmp/a/b`,
`/a/b/`: `/a/b`,
`C:\Documents\Newsletters\`: `C:\Documents\Newsletters\`,
`C:\`: `C:\`,
`\\.\pipe\\pipe\geth621383`: `\\.\pipe\\pipe\geth621383`,
}

Check failure on line 46 in internal/flags/flags_test.go

View workflow job for this annotation

GitHub Actions / Lint

File is not properly formatted (goimports)

t.Setenv(`DDDXXX`, `/tmp`)
for test, expected := range tests {
Expand Down
6 changes: 1 addition & 5 deletions rpc/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -846,11 +846,7 @@ func httpTestClient(srv *Server, transport string, fl *flakeyListener) (*Client,
// func ipcTestClient(srv *Server, fl *flakeyListener) (*Client, net.Listener) {
// // Listen on a random endpoint.
// endpoint := fmt.Sprintf("go-ethereum-test-ipc-%d-%d", os.Getpid(), rand.Int63())
// if runtime.GOOS == "windows" {
// endpoint = `\\.\pipe\` + endpoint
// } else {
// endpoint = os.TempDir() + "/" + endpoint
// }
// endpoint = os.TempDir() + "/" + endpoint
// l, err := ipcListen(endpoint)
// if err != nil {
// panic(err)
Expand Down
2 changes: 1 addition & 1 deletion scripts/actionlint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ for file in .github/workflows/*.{yml,yaml}; do
[[ -f "$file" ]] || continue

# Search for scripts/* except for scripts/run_task.sh
MATCHES=$(grep -H -n -p "scripts/(?!run_task\.sh)" "$file" || true)
MATCHES=$(grep -H -n -P "scripts/(?!run_task\.sh)" "$file" || true)
if [[ -n "${MATCHES}" ]]; then
echo "${MATCHES}"
SCRIPT_USAGE=1
Expand Down
Loading