Skip to content

Bump golang.org/x/net from 0.16.0 to 0.17.0 (#146) #145

Bump golang.org/x/net from 0.16.0 to 0.17.0 (#146)

Bump golang.org/x/net from 0.16.0 to 0.17.0 (#146) #145

#
# This GitHub action runs Packer go tests across
# multiple runners.
# only test results from ubuntu-latest environment will be posted to test obj storage bucket after GHA execution
#
name: "Go Test Multi-Platform"
on:
push:
branches:
- 'main'
- 'dev'
pull_request:
permissions:
contents: read
jobs:
get-go-version:
runs-on: ubuntu-latest
outputs:
go-version: ${{ steps.get-go-version.outputs.go-version }}
steps:
- uses: actions/checkout@v4
- name: 'Determine Go version'
id: get-go-version
run: |
echo "Found Go $(cat .go-version)"
echo "go-version=$(cat .go-version)" >> $GITHUB_OUTPUT
get-test-dependencies:

Check failure on line 31 in .github/workflows/go-test-multiplatform.yml

View workflow run for this annotation

GitHub Actions / Go Test Multi-Platform

Invalid workflow file

The workflow is not valid. .github/workflows/go-test-multiplatform.yml (Line: 31, Col: 5): Unexpected value 'get-test-dependencies'
runs-on: ubuntu-latest
steps:
- name: Install system deps
run: sudo apt-get install -y build-essential
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install Python deps
run: pip3 install requests wheel boto3
- name: Set release version env
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Install go-junit-report
run: go install github.com/jstemmer/go-junit-report/v2@latest
darwin-go-tests:
needs:
- get-go-version
runs-on: macos-latest
name: Darwin Go tests
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: ${{ needs.get-go-version.outputs.go-version }}
- run: |
echo "Testing with Go ${{ needs.get-go-version.outputs.go-version }}"
filename=$(ls | grep -E '^[0-9]{12}_packer_test_report\.json')
go test -race -count 1 ./... -timeout=3m -v
windows-go-tests:
needs:
- get-go-version
runs-on: windows-latest
name: Windows Go tests
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: ${{ needs.get-go-version.outputs.go-version }}
- run: |
echo "Testing with Go ${{ needs.get-go-version.outputs.go-version }}"
filename=$(ls | grep -E '^[0-9]{12}_packer_test_report\.json')
go test -race -count 1 ./... -timeout=3m -v
linux-go-tests:
needs:
- get-go-version
- get-test-dependencies
runs-on: ubuntu-latest
name: Linux Go tests
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: ${{ needs.get-go-version.outputs.go-version }}
- run: |
echo "Testing with Go ${{ needs.get-go-version.outputs.go-version }}"
filename=$(ls | grep -E '^[0-9]{12}_packer_test_report\.json')
go test -race -count 1 ./... -timeout=3m -v -json | tee "$filename"
- name: Convert JSON Report to XML
run: |
filename=$(ls | grep -E '^[0-9]{12}_packer_test_report\.json')
if [ -f "$filename" ]; then
go_junit_report_dir=$(go env GOPATH)/bin
export PATH="$PATH:$go_junit_report_dir"
xml_filename=$(echo "$filename" | sed 's/\.json$/.xml/')
go-junit-report < "$filename" > "$xml_filename"
echo "Conversion from JSON to XML completed successfully."
else
echo "JSON test report file not found."
exit 1
fi
env:
GO111MODULE: on
- name: Add additional information to XML report
run: |
filename=$(ls | grep -E '^[0-9]{12}_packer_test_report\.xml$')
python scripts/add_to_xml_test_report.py \
--branch_name "${{ env.RELEASE_VERSION }}" \
--gha_run_id "$GITHUB_RUN_ID" \
--gha_run_number "$GITHUB_RUN_NUMBER" \
--xmlfile "${filename}"
- name: Upload test results to bucket
env:
LINODE_CLI_OBJ_ACCESS_KEY: ${{ secrets.LINODE_CLI_OBJ_ACCESS_KEY }}
LINODE_CLI_OBJ_SECRET_KEY: ${{ secrets.LINODE_CLI_OBJ_SECRET_KEY }}
run: |
report_filename=$(ls | grep -E '^[0-9]{12}_packer_test_report\.xml$')
python3 scripts/test_report_upload_script.py "${report_filename}"