Skip to content

Commit 7a0ce67

Browse files
authored
Merge pull request #6423 from Algo-devops-service/relbeta4.3.0
2 parents 32dc751 + 8504c6d commit 7a0ce67

File tree

132 files changed

+15410
-3833
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

132 files changed

+15410
-3833
lines changed
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: 'Setup Go with caching'
2+
description: 'Set up Go with mod and build caching'
3+
inputs:
4+
cache-prefix:
5+
description: 'Cache prefix for advanced caching (e.g., "test", "build-e2e", "buildsrc")'
6+
required: false
7+
default: ''
8+
runs:
9+
using: 'composite'
10+
steps:
11+
- name: Get Go version
12+
id: go_version
13+
run: echo "GO_VERSION=$(./scripts/get_golang_version.sh)" >> $GITHUB_ENV
14+
shell: bash
15+
- name: Set up Go
16+
uses: actions/setup-go@v5
17+
with:
18+
go-version: ${{ env.GO_VERSION }}
19+
cache: ${{ inputs.cache-prefix == '' }}
20+
# branch-aware caching with fallback key prefixes following examples from:
21+
# https://github.com/algorand/go-algorand/blob/ab03c94d2008dd349b761ef2b949e17b361996a3/.circleci/config.yml#L407-L439
22+
# https://danp.net/posts/github-actions-go-cache/
23+
- name: Set cache date and paths
24+
if: inputs.cache-prefix != ''
25+
shell: bash
26+
run: |
27+
echo "GO_CACHE_DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
28+
echo "GOMODCACHE=$(go env GOMODCACHE)" >> $GITHUB_ENV
29+
echo "GOCACHE=$(go env GOCACHE)" >> $GITHUB_ENV
30+
- name: Cache Go modules
31+
if: inputs.cache-prefix != ''
32+
uses: actions/cache@v4
33+
with:
34+
path: ${{ env.GOMODCACHE }}
35+
key: ${{ inputs.cache-prefix }}-${{ runner.os }}-${{ runner.arch }}-go-mod-${{ github.ref_name }}-${{ hashFiles('**/go.sum') }}-${{ env.GO_CACHE_DATE }}
36+
restore-keys: |
37+
${{ inputs.cache-prefix }}-${{ runner.os }}-${{ runner.arch }}-go-mod-${{ github.ref_name }}-${{ hashFiles('**/go.sum') }}-
38+
${{ inputs.cache-prefix }}-${{ runner.os }}-${{ runner.arch }}-go-mod-${{ github.ref_name }}-
39+
${{ inputs.cache-prefix }}-${{ runner.os }}-${{ runner.arch }}-go-mod-master-
40+
${{ inputs.cache-prefix }}-${{ runner.os }}-${{ runner.arch }}-go-mod-
41+
- name: Cache Go build cache
42+
if: inputs.cache-prefix != ''
43+
uses: actions/cache@v4
44+
with:
45+
path: ${{ env.GOCACHE }}
46+
key: ${{ inputs.cache-prefix }}-${{ runner.os }}-${{ runner.arch }}-go-build-${{ github.ref_name }}-${{ hashFiles('**/go.sum') }}-${{ env.GO_CACHE_DATE }}
47+
restore-keys: |
48+
${{ inputs.cache-prefix }}-${{ runner.os }}-${{ runner.arch }}-go-build-${{ github.ref_name }}-${{ hashFiles('**/go.sum') }}-
49+
${{ inputs.cache-prefix }}-${{ runner.os }}-${{ runner.arch }}-go-build-${{ github.ref_name }}-
50+
${{ inputs.cache-prefix }}-${{ runner.os }}-${{ runner.arch }}-go-build-master-
51+
${{ inputs.cache-prefix }}-${{ runner.os }}-${{ runner.arch }}-go-build-
52+
- name: Download Go modules
53+
if: inputs.cache-prefix != ''
54+
shell: bash
55+
run: go mod download
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: 'Set up Test Environment'
2+
description: 'Set up testing environment for all platforms'
3+
inputs:
4+
install-expect:
5+
description: 'Whether to install expect package'
6+
required: false
7+
default: 'false'
8+
runs:
9+
using: 'composite'
10+
steps:
11+
- name: Cache libsodium
12+
uses: actions/cache@v4
13+
with:
14+
path: crypto/libs
15+
key: libsodium-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('crypto/libsodium-fork/**') }}
16+
- name: Build libsodium
17+
run: make libsodium
18+
shell: bash
19+
- name: Configure development environment
20+
if: runner.os != 'Linux'
21+
run: ./scripts/configure_dev.sh
22+
shell: bash
23+
# GHA Linux VMs provide all needed apt packages, except expect
24+
- name: Install expect package
25+
if: inputs.install-expect == 'true' && runner.os == 'Linux'
26+
run: |
27+
echo 'set man-db/auto-update false' | sudo debconf-communicate >/dev/null
28+
sudo dpkg-reconfigure -f noninteractive man-db
29+
sudo apt-get install -y --no-upgrade expect
30+
shell: bash
31+
- name: Cache gotestsum
32+
id: cache-gotestsum
33+
uses: actions/cache@v4
34+
with:
35+
path: ~/go/bin/gotestsum
36+
key: gotestsum-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('scripts/buildtools/versions') }}
37+
- name: Install gotestsum
38+
if: steps.cache-gotestsum.outputs.cache-hit != 'true'
39+
run: ./scripts/buildtools/install_buildtools.sh -o "gotest.tools/gotestsum"
40+
shell: bash
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: 'Slack Failure Notification'
2+
description: 'Send failure notification to Slack'
3+
inputs:
4+
job-type:
5+
description: 'Type of job that failed (e.g., Test, Integration Test, etc.)'
6+
required: true
7+
build-type:
8+
description: 'Type of build (e.g., PR Build, Nightly Build)'
9+
required: true
10+
details:
11+
description: 'Additional job-specific details (formatted string)'
12+
required: false
13+
default: ''
14+
runs:
15+
using: 'composite'
16+
steps:
17+
- name: Send Slack notification
18+
if: env.SLACK_WEBHOOK != ''
19+
uses: slackapi/slack-github-action@v2.1.0
20+
with:
21+
webhook: ${{ env.SLACK_WEBHOOK }}
22+
webhook-type: webhook-trigger
23+
payload: |
24+
{
25+
"text": "🚨 ${{ inputs.job-type }} Failure Alert",
26+
"blocks": [
27+
{
28+
"type": "section",
29+
"text": {
30+
"type": "mrkdwn",
31+
"text": "*${{ inputs.job-type }} Failure in ${{ inputs.build-type }}*\n\n• Job Type: `${{ github.job }}`\n• Platform: `${{ matrix.platform }}`${{ inputs.details != '' && format('\n{0}', inputs.details) || '' }}\n• Run URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
32+
}
33+
}
34+
]
35+
}

.github/workflows/benchmarks.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,13 @@ jobs:
1818
runs-on: ubuntu-latest
1919
steps:
2020
- uses: actions/checkout@v4
21-
- uses: actions/setup-go@v5
22-
with:
23-
go-version-file: 'go.mod'
21+
- name: Set up Go
22+
uses: ./.github/actions/setup-go
2423
- run: go version
2524
- name: Build go-algorand
26-
run: scripts/travis/build.sh
25+
run: |
26+
export SKIP_GO_INSTALLATION=True
27+
scripts/travis/build.sh
2728
# BenchmarkUintMath - Serves as a proxy for AVM `eval` performance.
2829
# Performance degradations suggest either or both: (1) op code
2930
# degradation, (2) `eval` degradation. (2) suggests a broader performance

.github/workflows/build.yml renamed to .github/workflows/build-windows.yml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,14 @@ jobs:
2020
uses: actions/checkout@v4
2121
with:
2222
fetch-depth: 0
23-
- name: Determine Go version
24-
id: go_version
25-
run: echo "GO_VERSION=$(./scripts/get_golang_version.sh)" >> $GITHUB_ENV
26-
- name: Install golang
27-
uses: actions/setup-go@v5
28-
with:
29-
go-version: ${{ env.GO_VERSION }}
23+
- name: Set up Go
24+
uses: ./.github/actions/setup-go
3025
- name: Restore libsodium from cache
3126
id: cache-libsodium
3227
uses: actions/cache@v4
3328
with:
3429
path: crypto/libs
35-
key: libsodium-fork-v2-${{ runner.os }}-${{ hashFiles('crypto/libsodium-fork/**') }}
30+
key: libsodium-fork-v2-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('crypto/libsodium-fork/**') }}
3631
- name: Build
3732
run: |
3833
export ALGORAND_DEADLOCK=enable

0 commit comments

Comments
 (0)