Skip to content

WIP: Testing github actions #2

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

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
139 changes: 125 additions & 14 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
name: "Build Windows"
name: "Build"
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build-windows:
runs-on: windows-2022
runs-on: windows-2025
defaults:
run:
shell: msys2 {0}
Expand Down Expand Up @@ -35,17 +37,126 @@ jobs:
key: libsodium-fork-v2-${{ runner.os }}-${{ hashFiles('crypto/libsodium-fork/**') }}
- name: Build
run: |
export ALGORAND_DEADLOCK=enable
export SKIP_GO_INSTALLATION=True
scripts/travis/build_test.sh
# - name: Upload artifact to Github
# uses: actions/upload-artifact@v2
# with:
# if-no-files-found: error
# path: $(git ls-files -o | grep -v crypto/libs | grep -v crypto/copies | grep -v crypto/libsodium-fork | grep -v crypto/lib/ | grep -v ^gen/ | grep -v swagger.json.validated | tr "\n" ":")
- name: Slack Notification
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
scripts/travis/build.sh --make_cibuild
- name: Generate checksums
run: |
SUMFILE=hashes_${CHANNEL:-$(./scripts/compute_branch_channel.sh $(./scripts/compute_branch.sh))}_windows_amd64_$(./scripts/compute_build_number.sh -f)
( cd tmp/node_pkgs/windows/amd64
find . -type f -name "*.tar.gz" -exec sh -c 'md5sum "$1" | awk "{print \$1 \" $1\"}"' _ {} \; | tee $SUMFILE
find . -type f -name "*.tar.gz" -exec sh -c 'shasum -a 256 "$1" | awk "{print \$1 \" $1\"}"' _ {} \;| tee -a $SUMFILE
find . -type f -name "*.tar.gz" -exec sh -c 'shasum -a 512 "$1" | awk "{print \$1 \" $1\"}"' _ {} \; | tee -a $SUMFILE
)
- name: Upload artifacts to Github
uses: actions/upload-artifact@v4
with:
if-no-files-found: error
name: build-windows-amd64
overwrite: true
path: |
tmp/node_pkgs/windows/amd64/*.tar.gz
tmp/node_pkgs/windows/amd64/hashes*
# - name: Slack Notification
# env:
# SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
# run: |
# curl -X POST --data-urlencode "payload={\"text\": \"Build windows failed. ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} \"}" $SLACK_WEBHOOK
# if: ${{ failure() && (contains(github.ref_name, 'rel/nightly') || contains(github.ref_name, 'rel/beta') || contains(github.ref_name, 'rel/stable') || contains(github.ref_name, 'master')) }}
build-linux:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ "ubuntu-24.04", "ubuntu-24.04-arm" ]
steps:
- name: Check out code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Determine Go version
id: go_version
run: echo "GO_VERSION=$(./scripts/get_golang_version.sh)" >> $GITHUB_ENV
- name: Install golang
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- name: Restore libsodium from cache
id: cache-libsodium
uses: actions/cache@v4
with:
path: crypto/libs
key: libsodium-fork-v2-${{ runner.os }}-${{ hashFiles('crypto/libsodium-fork/**') }}
- name: Build
run: |
curl -X POST --data-urlencode "payload={\"text\": \"Build windows failed. ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} \"}" $SLACK_WEBHOOK
if: ${{ failure() && (contains(github.ref_name, 'rel/nightly') || contains(github.ref_name, 'rel/beta') || contains(github.ref_name, 'rel/stable') || contains(github.ref_name, 'master')) }}
./scripts/configure_dev.sh
./scripts/buildtools/install_buildtools.sh
make ci-build
- name: Generate checksums
run: |
SUMFILE=hashes_${CHANNEL:-$(./scripts/compute_branch_channel.sh $(./scripts/compute_branch.sh))}_linux_$(./scripts/archtype.sh)_$(./scripts/compute_build_number.sh -f)
( cd tmp/node_pkgs/linux/$(./scripts/archtype.sh)
find . -type f -name "*.tar.gz" -exec sh -c 'md5sum "$1" | awk "{print \$1 \" $1\"}"' _ {} \; | tee $SUMFILE
find . -type f -name "*.tar.gz" -exec sh -c 'shasum -a 256 "$1" | awk "{print \$1 \" $1\"}"' _ {} \;| tee -a $SUMFILE
find . -type f -name "*.tar.gz" -exec sh -c 'shasum -a 512 "$1" | awk "{print \$1 \" $1\"}"' _ {} \; | tee -a $SUMFILE
)
- name: Upload artifacts to Github
uses: actions/upload-artifact@v4
with:
if-no-files-found: error
name: build-linux-${{ matrix.os }}
overwrite: true
path: |
tmp/node_pkgs/**/*.tar.gz
tmp/node_pkgs/**/hashes*
# - name: Slack Notification
# env:
# SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
# run: |
# curl -X POST --data-urlencode "payload={\"text\": \"Build windows failed. ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} \"}" $SLACK_WEBHOOK
# if: ${{ failure() && (contains(github.ref_name, 'rel/nightly') || contains(github.ref_name, 'rel/beta') || contains(github.ref_name, 'rel/stable') || contains(github.ref_name, 'master')) }}
build-macos:
runs-on: macos-latest
steps:
- name: Check out code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Determine Go version
id: go_version
run: echo "GO_VERSION=$(./scripts/get_golang_version.sh)" >> $GITHUB_ENV
- name: Install golang
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- name: Restore libsodium from cache
id: cache-libsodium
uses: actions/cache@v4
with:
path: crypto/libs
key: libsodium-fork-v2-${{ runner.os }}-${{ hashFiles('crypto/libsodium-fork/**') }}
- name: Build
run: |
./scripts/configure_dev.sh
./scripts/buildtools/install_buildtools.sh
make ci-build-universal
- name: Generate checksums
run: |
SUMFILE=hashes_${CHANNEL:-$(./scripts/compute_branch_channel.sh $(./scripts/compute_branch.sh))}_darwin_universal_$(./scripts/compute_build_number.sh -f)
( cd tmp/node_pkgs/darwin/universal
find . -type f -name "*.tar.gz" -exec sh -c 'shasum -a 256 "$1" | awk "{print \$1 \" $1\"}"' _ {} \; | tee $SUMFILE
find . -type f -name "*.tar.gz" -exec sh -c 'shasum -a 512 "$1" | awk "{print \$1 \" $1\"}"' _ {} \; | tee -a $SUMFILE
)
- name: Upload artifacts to Github
uses: actions/upload-artifact@v4
with:
if-no-files-found: error
name: build-darwin-universal
overwrite: true
path: |
tmp/node_pkgs/darwin/universal/*.tar.gz
tmp/node_pkgs/darwin/universal/hashes*
# - name: Slack Notification
# env:
# SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
# run: |
# curl -X POST --data-urlencode "payload={\"text\": \"Build windows failed. ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} \"}" $SLACK_WEBHOOK
# if: ${{ failure() && (contains(github.ref_name, 'rel/nightly') || contains(github.ref_name, 'rel/beta') || contains(github.ref_name, 'rel/stable') || contains(github.ref_name, 'master')) }}
31 changes: 31 additions & 0 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Run Short Tests

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

jobs:
build:

runs-on: ubuntu-24.04

steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.23.3'

- name: Print go version
run: go version

- name: Install dependencies
run: ./scripts/configure_dev.sh

- name: Install buildtools
run: ./scripts/buildtools/install_buildtools.sh

- name: Run tests
run: make shorttest

7 changes: 7 additions & 0 deletions scripts/travis/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ while [ "$1" != "" ]; do
shift
MAKE_UNIVERSAL_OPTION="1"
;;
--make_cibuild)
shift
MAKE_CIBUILD_OPTION="1"
;;
*)
echo "Unknown option" "$1"
exit 1
Expand Down Expand Up @@ -92,6 +96,9 @@ if [ "${MAKE_UNIVERSAL_OPTION}" != "" ]; then
elif [ "${MAKE_DEBUG_OPTION}" != "" ]; then
make build build-race
duration "make build build-race"
elif [ "${MAKE_CIBUILD_OPTION}" != "" ]; then
make ci-build
duration "make ci-build"
else
make build
duration "make build"
Expand Down
Loading