Skip to content
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

Run integration tests as part of CI #111

Merged
merged 12 commits into from
Sep 6, 2023
32 changes: 30 additions & 2 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
- main
workflow_dispatch:

name: Test
name: Tests
jobs:
test:
runs-on: ubuntu-latest
Expand All @@ -19,9 +19,37 @@ jobs:
- name: Setup go
uses: actions/setup-go@v2
with:
go-version: "1.21.0"
go-version: 1.21.0
Maelkum marked this conversation as resolved.
Show resolved Hide resolved

- name: Run Test
run: |
go test ./... -covermode=count -coverprofile=coverage.out
go tool cover -func=coverage.out -o=coverage.out

integration-tests:
name: integration tests
# Run on older Ubuntu version because of older LibSSL dependency.
runs-on: ubuntu-20.04
steps:
- name: Checkout Code
uses: actions/checkout@v2
with:
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal access token.
fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository.

- name: Set up Go 1.21.0
uses: actions/setup-go@v2
with:
go-version: 1.21.0

- name: Install Blockless Runtime
run: |
mkdir -p /tmp/blockless-runtime
curl -L -o runtime.tar.gz https://github.com/blocklessnetwork/runtime/releases/download/v0.0.13/blockless-runtime.ubuntu-20.04.x86_64.tar.gz
tar xzf runtime.tar.gz -C /tmp/blockless-runtime
rm runtime.tar.gz

- name: Run integration tests
run: |
export B7S_INTEG_RUNTIME_DIR=/tmp/blockless-runtime
go test --tags=integration ./...