Skip to content

Commit

Permalink
Merge branch 'main' into check-message-already-delivered
Browse files Browse the repository at this point in the history
  • Loading branch information
cam-schultz committed Sep 7, 2023
2 parents 6505639 + 7168076 commit 8a4d9c2
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@ jobs:
- name: Run Relayer Unit Tests
run: |
cd awm-relayer
go test ./...
./scripts/test.sh
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ To start developing on AWM Relayer, you'll need Golang >= v1.18.1.
- Run the unit tests

```sh
go test ./...
./scripts/test.sh
```

### Continuous Integration (CI)
Expand Down
7 changes: 4 additions & 3 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,14 @@ if version_lt "$(go_version)" "$go_version_minimum"; then
fi

# Root directory
AWM_RELAYER_PATH=$(
RELAYER_PATH=$(
cd "$(dirname "${BASH_SOURCE[0]}")"
cd .. && pwd
)

# Load the versions
source "$AWM_RELAYER_PATH"/scripts/versions.sh
# Load the versions and constants
source "$RELAYER_PATH"/scripts/versions.sh
source "$RELAYER_PATH"/scripts/constants.sh

if [[ $# -eq 1 ]]; then
binary_path=$1
Expand Down
6 changes: 4 additions & 2 deletions scripts/build_local_image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ set -o nounset
set -o pipefail

# Directory above this script
RELAYER_PATH=$( cd "$( dirname "${BASH_SOURCE[0]}" )"; cd .. && pwd )

RELAYER_PATH=$(
cd "$(dirname "${BASH_SOURCE[0]}")"
cd .. && pwd
)
# Load the constants
source "$RELAYER_PATH"/scripts/constants.sh

Expand Down
14 changes: 13 additions & 1 deletion scripts/constants.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
# Use lower_case variables in the scripts and UPPER_CASE variables for override
# Use the constants.sh for env overrides

RELAYER_PATH=$( cd "$( dirname "${BASH_SOURCE[0]}" )"; cd .. && pwd ) # Directory above this script
RELAYER_PATH=$(
cd "$(dirname "${BASH_SOURCE[0]}")"
cd .. && pwd
)

# Where AWM Relayer binary goes
relayer_path="$RELAYER_PATH/build/awm-relayer"
Expand All @@ -22,3 +25,12 @@ relayer_dockerhub_repo=${DOCKER_REPO:-"awm-relayer"}
current_branch=$(git symbolic-ref -q --short HEAD || git describe --tags --exact-match || true)

git_commit=${RELAYER_COMMIT:-$( git rev-list -1 HEAD )}

# Set the CGO flags to use the portable version of BLST
#
# We use "export" here instead of just setting a bash variable because we need
# to pass this flag to all child processes spawned by the shell.
export CGO_CFLAGS="-O -D__BLST_PORTABLE__"
# While CGO_ENABLED doesn't need to be explicitly set, it produces a much more
# clear error due to the default value change in go1.20.
export CGO_ENABLED=1
16 changes: 16 additions & 0 deletions scripts/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env bash
# Copyright (C) 2023, Ava Labs, Inc. All rights reserved.
# See the file LICENSE for licensing terms.

set -o errexit
set -o nounset
set -o pipefail

# Directory above this script
RELAYER_PATH=$(
cd "$(dirname "${BASH_SOURCE[0]}")"
cd .. && pwd
)
source "$RELAYER_PATH"/scripts/constants.sh

go test ./...

0 comments on commit 8a4d9c2

Please sign in to comment.