Dockerized Tests #1134
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Go Agent CI - Dockerized | |
on: pull_request | |
env: | |
# Specifies which go version to run integration tests on | |
INTEGRATION_TESTS_GO_VERSION: 1.21.5 | |
jobs: | |
go-agent-v3: | |
runs-on: ubuntu-latest | |
strategy: | |
# if one test fails, do not abort the rest | |
fail-fast: false | |
matrix: | |
include: | |
# Core Tests on 3 most recent major Go versions | |
- go-version: 1.19.0 | |
dirs: v3/newrelic,v3/internal,v3/examples | |
- go-version: 1.20.0 | |
dirs: v3/newrelic,v3/internal,v3/examples | |
- go-version: 1.21.0 | |
dirs: v3/newrelic,v3/internal,v3/examples | |
# Integration Tests on highest Supported Go Version | |
- dirs: v3/integrations/nramqp | |
- dirs: v3/integrations/nrfasthttp | |
- dirs: v3/integrations/nrsarama | |
- dirs: v3/integrations/logcontext/nrlogrusplugin | |
- dirs: v3/integrations/logcontext-v2/nrlogrus | |
- dirs: v3/integrations/logcontext-v2/nrzerolog | |
- dirs: v3/integrations/logcontext-v2/nrzap | |
- dirs: v3/integrations/logcontext-v2/nrwriter | |
- dirs: v3/integrations/logcontext-v2/zerologWriter | |
- dirs: v3/integrations/logcontext-v2/logWriter | |
- dirs: v3/integrations/nrawssdk-v1 | |
- dirs: v3/integrations/nrawssdk-v2 | |
- dirs: v3/integrations/nrecho-v3 | |
- dirs: v3/integrations/nrecho-v4 | |
- dirs: v3/integrations/nrelasticsearch-v7 | |
- dirs: v3/integrations/nrgin | |
- dirs: v3/integrations/nrgorilla | |
- dirs: v3/integrations/nrgraphgophers | |
- dirs: v3/integrations/nrlogrus | |
- dirs: v3/integrations/nrlogxi | |
- dirs: v3/integrations/nrpkgerrors | |
- dirs: v3/integrations/nrlambda | |
- dirs: v3/integrations/nrmysql | |
- dirs: v3/integrations/nrpq | |
- dirs: v3/integrations/nrpgx5 | |
- dirs: v3/integrations/nrpq/example/sqlx | |
- dirs: v3/integrations/nrredis-v7 | |
- dirs: v3/integrations/nrredis-v9 | |
- dirs: v3/integrations/nrsqlite3 | |
- dirs: v3/integrations/nrsnowflake | |
- dirs: v3/integrations/nrgrpc | |
- dirs: v3/integrations/nrmicro | |
- dirs: v3/integrations/nrnats | |
goproxy: direct | |
- dirs: v3/integrations/nrstan | |
- dirs: v3/integrations/nrstan/test | |
- dirs: v3/integrations/nrstan/examples | |
- dirs: v3/integrations/logcontext | |
- dirs: v3/integrations/nrzap | |
- dirs: v3/integrations/nrhttprouter | |
- dirs: v3/integrations/nrb3 | |
- dirs: v3/integrations/nrmongo | |
- dirs: v3/integrations/nrgraphqlgo,v3/integrations/nrgraphqlgo/example | |
- dirs: v3/integrations/nrmssql | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v2 | |
with: | |
path: "go-agent" | |
- name: Build Docker Image | |
run: docker build -f ${{ github.workspace }}/go-agent/Dockerfile ${{ github.workspace }} --build-arg GO_VERSION=${{ matrix.go-version || env.INTEGRATION_TESTS_GO_VERSION }} -t go-agent-tests-amd64 | |
- name: Run Tests in Docker | |
run: | | |
IFS=',' read -ra DIRS <<< "${{ matrix.dirs }}" | |
for dir in "${DIRS[@]}"; do | |
if [ -d "go-agent/$dir" ]; then | |
if [[ "$dir" == *"nrnats"* ]]; then | |
docker run -e GOPROXY=direct go-agent-tests-amd64 ./go-agent/run-tests.sh "$dir" | |
else | |
docker run go-agent-tests-amd64 ./go-agent/run-tests.sh "$dir" | |
fi | |
else | |
echo "Directory /app/$dir does not exist." | |
fi | |
done | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v3 | |
# Arm64 tests | |
go-agent-v3-arm64: | |
runs-on: ubuntu-latest | |
strategy: | |
# if one test fails, do not abort the rest | |
fail-fast: false | |
matrix: | |
include: | |
# Core Tests on 3 most recent major Go versions | |
- go-version: 1.19.0 | |
dirs: v3/newrelic,v3/internal,v3/examples | |
- go-version: 1.20.0 | |
dirs: v3/newrelic,v3/internal,v3/examples | |
- go-version: 1.21.0 | |
dirs: v3/newrelic,v3/internal,v3/examples | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v2 | |
with: | |
path: "go-agent" | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v1 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Build Docker Image | |
run: | | |
docker buildx create --use | |
docker buildx build --platform linux/arm64 -f ${{ github.workspace }}/go-agent/Dockerfile ${{ github.workspace }} --build-arg GO_VERSION=${{ matrix.go-version || env.INTEGRATION_TESTS_GO_VERSION }} -t go-agent-tests-arm64 --load | |
- name: Run Tests in Docker | |
run: | | |
IFS=',' read -ra DIRS <<< "${{ matrix.dirs }}" | |
for dir in "${DIRS[@]}"; do | |
if [ -d "go-agent/$dir" ]; then | |
docker run go-agent-tests-arm64 ./go-agent/run-tests.sh "$dir" | |
else | |
echo "Directory /app/$dir does not exist." | |
fi | |
done | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v3 |