Skip to content

modify github workflow #1

modify github workflow

modify github workflow #1

# This workflow will test and run code coverage for the golang project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
name: Build Test Coverage
on:
pull_request:
push:
env:
TEST_RESULTS: /tmp/test-results
jobs:
build-release-x86_64:
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: '1.20'
cache: true
- name: Create test directory
run: mkdir -p $TEST_RESULTS
- name: Install gotestsum
run: go install gotest.tools/gotestsum@latest
- name: Run unit tests
run: |
PACKAGE_NAMES=$(go list ./... | xargs)
gotestsum --junitfile ${TEST_RESULTS}/gotestsum-report.xml -- $PACKAGE_NAMES
- name: Run build
run: make build
# build-release-arm:
# runs-on: ubuntu-20.04
# if: startsWith(github.ref, 'refs/tags/v')
# steps:
# - uses: actions/checkout@v4
# - name: Setup Go
# uses: actions/setup-go@v4
# with:
# go-version: '1.20'
# - name: Build and archive arm distribution
# run: make zip-arm64
# - name: Publish zip-arm64 release on GitHub
# uses: softprops/action-gh-release@v1
# with:
# files: /tmp/newrelic-lambda-extension.arm64.zip
# token: ${{ secrets.GITHUB_TOKEN }}
# tag_name: ${{ github.ref_name }}
# name: "Release ${{ github.ref_name }}"
# draft: false
# prerelease: false