Skip to content

Commit

Permalink
Fix CI; pin Go version explicitly (#1027)
Browse files Browse the repository at this point in the history
  • Loading branch information
ofalvai authored Dec 4, 2024
1 parent 29bfc47 commit df96588
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1 +1 @@
golang 1.21
golang 1.21.13
52 changes: 34 additions & 18 deletions bitrise.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,12 @@ stages:
workflows:
run_lint:
steps:
- bundle::setup_repo: { }
- bundle::run_lint: { }

run_unit_tests_macos:
steps:
- bundle::setup_repo: { }
- bundle::setup_go_junit_report: { }
- bundle::run_unit_tests: { }
meta:
Expand All @@ -47,11 +49,13 @@ workflows:

run_unit_tests_linux:
steps:
- bundle::setup_repo: { }
- bundle::setup_go_junit_report: { }
- bundle::run_unit_tests: { }

run_integration_tests_macos:
steps:
- bundle::setup_repo: { }
- bundle::setup_go_junit_report: { }
- bundle::run_integration_tests: { }
meta:
Expand All @@ -61,22 +65,25 @@ workflows:

run_integration_tests_linux:
steps:
- bundle::setup_repo: { }
- bundle::setup_go_junit_report: { }
- bundle::run_integration_tests: { }

run_docker_integration_tests_linux:
steps:
- bundle::setup_repo: { }
- bundle::setup_go_junit_report: { }
- bundle::run_docker_integration_tests:
envs:
- SRC_DIR_IN_GOPATH: $BITRISE_SOURCE_DIR
meta:
bitrise.io:
machine_type_id: elite-xl
machine_type_id: g2.linux.x-large
stack: linux-docker-android-20.04 # TODO: Docker tests are failing on Ubuntu 22.04

test_binary_build_macos:
steps:
- bundle::setup_repo: { }
- bundle::setup_goreleaser: { }
- bundle::test_binary_build: { }
meta:
Expand All @@ -86,6 +93,7 @@ workflows:

test_binary_build_linux:
steps:
- bundle::setup_repo: { }
- bundle::setup_goreleaser: { }
- bundle::test_binary_build: { }

Expand Down Expand Up @@ -168,9 +176,6 @@ workflows:
step_bundles:
run_lint:
steps:
- git-clone@8:
inputs:
- fetch_tags: "yes"
- git::https://github.com/bitrise-steplib/steps-check.git:
inputs:
- workflow: lint
Expand All @@ -179,9 +184,6 @@ step_bundles:

run_unit_tests:
steps:
- git-clone@8:
inputs:
- fetch_tags: "yes"
- script@1:
title: Run unit tests
inputs:
Expand Down Expand Up @@ -218,9 +220,6 @@ step_bundles:

run_integration_tests:
steps:
- git-clone@8:
inputs:
- fetch_tags: "yes"
- script@1:
title: Run integration tests
inputs:
Expand Down Expand Up @@ -268,9 +267,6 @@ step_bundles:

run_docker_integration_tests:
steps:
- git-clone@8:
inputs:
- fetch_tags: "yes"
- script@1:
title: Run integration tests
inputs:
Expand Down Expand Up @@ -309,13 +305,17 @@ step_bundles:
mkdir -p "${test_results_dir}"
cp "${ORIG_BITRISE_DEPLOY_DIR}/${linux_only_test_log_file_name}.xml" "${test_results_dir}/${linux_only_test_log_file_name}.xml"
echo "${linux_only_test_name_json}" > "${test_results_dir}/test-info.json"
- script:
# The Go + ASDF situation is messed up on the Ubuntu 20 stack. Even though this workflow starts by installing
# the correct Go version with ASDF, the first non-Bash-toolkit step (deploy-to-bitrise-io) will fail,
# probably because the CLI process (which runs the steps) is already running by the time the Go version is set.
title: Ubuntu 20 Go hackery # TODO: remove this once the workflow is migrated to the Ubuntu 22 stack
inputs:
- content: rm ~/.asdf/shims/go
- deploy-to-bitrise-io@2: { }

test_binary_build:
steps:
- git-clone@8:
inputs:
- fetch_tags: "yes"
- script@1:
title: Create snapshot binaries
deps:
Expand All @@ -329,6 +329,21 @@ step_bundles:
goreleaser release --snapshot --rm-dist
- deploy-to-bitrise-io@2: { }

setup_repo:
steps:
- git-clone@8:
inputs:
- fetch_tags: "yes"
- script:
title: Setup Go version
inputs:
- content: |-
#!/bin/bash
set -ex
asdf plugin add golang || true # TODO: can be removed once all workflows are migrated to Ubuntu 22
asdf install golang
setup_go_junit_report:
steps:
- script@1:
Expand All @@ -338,7 +353,7 @@ step_bundles:
#!/usr/bin/env bash
set -ex
go install github.com/jstemmer/go-junit-report/v2@latest
asdf reshim golang || true
asdf reshim golang
setup_goreleaser:
steps:
Expand All @@ -353,9 +368,10 @@ step_bundles:
sudo dpkg -i /tmp/goreleaser.deb
else
go install github.com/goreleaser/goreleaser@latest
asdf reshim golang
fi
meta:
bitrise.io:
machine_type_id: elite-xl
machine_type_id: g2.linux.x-large
stack: linux-docker-android-22.04

0 comments on commit df96588

Please sign in to comment.