2021-12-11 10:06:56 -08:00
name : Build
on :
workflow_dispatch :
pull_request :
push :
branches :
- dev.v2
jobs :
# Run the full Tilt build and wait for it to converge
tilt :
runs-on : tilt-kube-public
# Cancel previous builds on the same branch/ref. Full runs are expensive
# and capacity is limited, so we want to avoid running multiple builds
# in parallel even if it means skipping CI runs on permanent branches
# (unfortunately, we can't differentiate between temporary and permanent
# refs without duplicating the entire logic).
concurrency :
2022-03-03 12:16:28 -08:00
group : ${{ github.workflow }}-tilt-${{ github.ref }}
2021-12-11 10:06:56 -08:00
cancel-in-progress : true
steps :
- uses : actions/checkout@v2
- name : Expand for link to Tilt dashboard (only available during build)
run : >
echo "Tilt progress dashboard: https://$DASHBOARD_URL"
- run : |
kubectl config set-context ci --namespace=$DEPLOY_NS
kubectl config use-context ci
2022-04-01 10:43:51 -07:00
- run : tilt ci -- --ci --namespace=$DEPLOY_NS --num=2
2021-12-11 10:06:56 -08:00
timeout-minutes : 60
# Clean up k8s resources
2022-02-11 21:21:39 -08:00
- run : kubectl delete --namespace=$DEPLOY_NS service,statefulset,configmap,pod,job --all
2021-12-11 10:06:56 -08:00
if : always()
# Verify whether the Makefile builds the node (no dependencies other than Go)
node :
runs-on : ubuntu-20.04
steps :
- uses : actions/checkout@v2
- uses : actions/setup-go@v2
with :
2022-05-31 13:47:31 -07:00
go-version : "1.17.5"
2021-12-11 10:06:56 -08:00
- run : make node
2022-05-31 13:47:31 -07:00
algorand :
runs-on : ubuntu-20.04
steps :
- uses : actions/checkout@v3
- uses : actions/setup-python@v3
with :
python-version : "3.10"
- run : pip install -r algorand/requirements.txt
- run : cd algorand && make test
2022-03-30 21:32:27 -07:00
ethereum :
runs-on : ubuntu-20.04
steps :
- uses : actions/checkout@v2
- uses : actions/setup-node@v2
with :
2022-05-31 13:47:31 -07:00
node-version : "16"
2022-03-30 21:32:27 -07:00
- run : cd ethereum && make test
2022-04-06 09:25:18 -07:00
terra :
runs-on : ubuntu-20.04
steps :
- uses : actions/checkout@v2
- uses : actions/setup-node@v2
with :
2022-05-31 13:47:31 -07:00
node-version : "16"
2022-04-06 09:25:18 -07:00
- run : cd terra && make test
2022-06-16 09:48:01 -07:00
terra-2 :
runs-on : ubuntu-20.04
steps :
- uses : actions/checkout@v2
- uses : actions/setup-node@v2
with :
node-version : "16"
- run : cd cosmwasm && make test
2021-12-19 09:42:10 -08:00
# Run linters, Go tests and other outside-of-Tilt things.
lint-and-tests :
2021-12-11 10:06:56 -08:00
# The linter is slow enough that we want to run it on the self-hosted runner
runs-on : tilt-kube-public
concurrency :
2022-03-03 12:16:28 -08:00
group : ${{ github.workflow }}-lint-${{ github.ref }}
2021-12-11 10:06:56 -08:00
cancel-in-progress : true
steps :
- uses : actions/checkout@v2
- uses : actions/setup-go@v2
with :
2022-05-31 13:47:31 -07:00
go-version : "1.17.5"
2022-06-01 09:16:31 -07:00
# ensure that code is formatted
2022-06-01 09:32:37 -07:00
- run : GOFMT_OUTPUT="$(gofmt -l `find ./node ./event_database -name '*.go' | grep -v vendor` 2>&1)"; if [ -n "$GOFMT_OUTPUT" ]; then printf "All the following files are not correctly formatted\n${GOFMT_OUTPUT}\n"; exit 1; fi
2022-06-01 09:16:31 -07:00
# run linters
2021-12-11 10:06:56 -08:00
- run : make generate && ./lint.sh
2022-04-28 09:20:38 -07:00
# The go-ethereum and celo-blockchain packages both implement secp256k1 using the exact same header, but that causes duplicate symbols.
- run : cd node && go test -v -ldflags '-extldflags "-Wl,--allow-multiple-definition" ' ./...
2022-03-30 02:11:40 -07:00
# Run rust lints and tests
rust-lint-and-tests :
runs-on : ubuntu-20.04
strategy :
matrix :
manifest :
- terra/Cargo.toml
- sdk/rust/Cargo.toml
steps :
- name : Check out source
uses : actions/checkout@v2
- name : Install stable rust toolchain
uses : actions-rs/toolchain@v1
with :
profile : minimal
toolchain : stable
2022-04-01 00:21:21 -07:00
default : true
2022-03-30 02:11:40 -07:00
- name : Run `cargo check`
uses : actions-rs/cargo@v1
with :
command : check
args : --workspace --manifest-path ${{ matrix.manifest }}
2022-04-01 00:21:21 -07:00
- name : Run `cargo test`
uses : actions-rs/cargo@v1
with :
command : test
args : --workspace --manifest-path ${{ matrix.manifest }}