Skip to content

Conversation

@Sawsqr68
Copy link

@Sawsqr68 Sawsqr68 commented Jan 9, 2026

This pull request introduces a new GitHub Actions workflow in .github/workflows/webpack.yml to automate build and test processes for Node.js (with Webpack) and Go projects. The workflow adds comprehensive examples for setting up multiple Node.js and Go versions, demonstrates advanced caching strategies, and provides detailed configuration options for Go environments.

The most important changes are:

Workflow Automation and Build Enhancements:

  • Added a new workflow (.github/workflows/webpack.yml) that triggers on pushes and pull requests to the main branch, automating builds for Node.js (with Webpack) and Go projects across multiple versions and operating systems.
  • Configured matrix builds for both Node.js (versions 18.x, 20.x, 22.x) and Go (versions 1.21, 1.22, 1.23), enabling parallel testing and ensuring compatibility across environments.

Go Environment and Caching Improvements:

  • Introduced advanced Go setup steps, including support for version ranges, RC/beta versions, and reading versions from files like go.mod, go.work, .go-version, and .tool-versions.
  • Implemented robust caching strategies for both Node.js and Go dependencies using @actions/cache, with examples for saving and restoring caches, cache key management, and cache path configuration. (F197aUpdated GitHub Actions workflow for Go and Webpack builds, including caching and version management.

Description:
Describe your changes.

Related issue:
Add link to the related issue.

Check list:

  • Mark if documentation changes are required.
  • Mark if tests were added or updated to cover the changes.
    This pull request adds a new GitHub Actions workflow in .github/workflows/webpack.yml to automate building and testing Node.js and Go projects across multiple environments. The workflow introduces comprehensive build matrix strategies, version management, and caching improvements for both Node.js (with Webpack) and Go, supporting a wide range of versions and configurations.

Key changes:

Workflow automation and build matrix:

  • Introduced a new workflow that runs on both push and pull_request events for the main branch, automating builds for multiple Node.js versions (18.x, 20.x, 22.x) and various Go versions (including stable, oldstable, RC, and beta) across different operating systems (Ubuntu, macOS, Windows).
  • Added a test job matrix to run Go tests against multiple Go versions (1.21, 1.22, 1.23), ensuring compatibility and reliability across supported environments.

Node.js and Webpack integration:

  • Configured steps to install dependencies and run Webpack builds for Node.js projects, ensuring that the build process is consistent and reproducible in CI.

Go version management and advanced configuration:

  • Provided detailed examples and configurations for specifying Go versions via direct version strings, version files (go.mod, go.work, .go-version, .tool-versions),

Updated GitHub Actions workflow for Go and Webpack builds, including caching and version management.
Copilot AI review requested due to automatic review settings January 9, 2026 14:38
@Sawsqr68 Sawsqr68 requested a review from a team as a code owner January 9, 2026 14:38
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request attempts to add a new GitHub Actions workflow file for automating builds and tests for Node.js (with Webpack) and Go projects. However, the workflow file contains critical structural issues that prevent it from being a valid GitHub Actions workflow.

Key Issues:

  • The YAML structure is fundamentally broken with multiple disconnected sections, duplicate job declarations, and improperly formatted content
  • Non-existent action versions are referenced (checkout@v6, cache/restore@v5)
  • Non-existent Go versions are specified (1.24.10, 1.24.0-rc.1, 1.23.0-beta.1)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +231 to +233
permissions:
contents: read # Required to checkout code and install dependencies

Copy link

Copilot AI Jan 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line contains a "permissions:" keyword that is improperly placed within the workflow file. The "permissions" should be defined at the workflow level or job level, not floating at line 231 after other content. This will cause YAML parsing errors.

Suggested change
permissions:
contents: read # Required to checkout code and install dependencies

Copilot uses AI. Check for mistakes.
Comment on lines +29 to +233
steps:
- uses: actions/checkout@v5
- uses: actions/setup-go@v6
with:
go-version: '1.23'
- run: go version
go 1.23.0 // Minimum required version
toolchain go1.23.2 // V6 uses this exact version
steps:
- uses: actions/checkout@v5
- uses: actions/setup-go@v6
with:
go-version: '1.23'
- run: go run hello.go
steps:
- uses: actions/checkout@v5
- uses: actions/setup-go@v6
with:
steps:
- uses: actions/checkout@v5
- uses: actions/setup-go@v6
with:
go-version: '>=1.22.0'
- run: go version
go-version: '^1.23.1' # The Go version to download (if necessary) and use.
- run: go version
go-version: '1.22' # Correct
go-version: 1.22 # Incorrect - YAML parser interprets as 1.2
# RC version
steps:
- uses: actions/checkout@v5
- uses: actions/setup-go@v6
with:
go-version: '1.24.0-rc.1' # The Go version to download (if necessary) and use
- run: go version
# Beta version
steps:
- uses: actions/checkout@v5
- uses: actions/setup-go@v6
with:
go-version: '1.23.0-beta.1' # The Go version to download (if necessary) and use
- run: go version
steps:
- uses: actions/checkout@v5
- uses: actions/setup-go@v6
with:
go-version: 'stable' # Latest stable version
- run: go version
steps:
- uses: actions/checkout@v5
- uses: actions/setup-go@v6
with:
go-version: 'oldstable' # Previous stable version
- run: go version
steps:
- uses: actions/checkout@v5
- uses: actions/setup-go@v6
with:
go-version-file: 'go.mod'
- run: go version
steps:
- uses: actions/checkout@v5
- uses: actions/setup-go@v6
with:
go-version-file: 'go.work'
- run: go version
steps:
- uses: actions/checkout@v5
- uses: actions/setup-go@v6
with:
go-version-file: '.go-version'
- run: go version
steps:
- uses: actions/checkout@v5
- uses: actions/setup-go@v6
with:
go-version-file: '.tool-versions'
- run: go version
steps:
- uses: actions/checkout@v5
- uses: actions/setup-go@v6
with:
go-version: '1.23'
check-latest: true # Always check for the latest patch release
- run: go version
steps:
- uses: actions/checkout@v5
- uses: actions/setup-go@v6
with:
go-version: '1.23'
# cache: true (default)
- run: go run hello.go
const cache = require('@actions/cache');
const paths = [
'node_modules',
'packages/*/node_modules/'
]
const key = 'npm-foobar-d5ea0750'
const cacheId = await cache.saveCache(paths, key)
const cache = require('@actions/cache');
const paths = [
'node_modules',
'packages/*/node_modules/'
]
const key = 'npm-foobar-d5ea0750'
const restoreKeys = [
'npm-foobar-',
'npm-'
]
const cacheKey = await cache.restoreCache(paths, key, restoreKeys)
# In some workflows, you may want to restore a cache without saving it. This can help reduce cache writes and storage usage in workflows that only need to read from cache
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v6
- name: Setup Go
id: setup-go
uses: actions/setup-go@v6
with:
go-version: '1.24.10'
cache: false
# Capture Go cache locations
- name: Set Go cache variables (Linux/macOS)
if: runner.os != 'Windows'
run: |
echo "GO_MOD_CACHE=$(go env GOMODCACHE)" >> $GITHUB_ENV
echo "GO_BUILD_CACHE=$(go env GOCACHE)" >> $GITHUB_ENV
- name: Set Go cache variables (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
echo "GO_MOD_CACHE=$(go env GOMODCACHE)" | Out-File $env:GITHUB_ENV -Append
echo "GO_BUILD_CACHE=$(go env GOCACHE)" | Out-File $env:GITHUB_ENV -Append
# Normalize runner.arch to lowercase to ensure consistent cache keys
- name: Normalize runner architecture (Linux/macOS)
if: runner.os != 'Windows'
shell: bash
run: echo "ARCH=$(echo '${{ runner.arch }}' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
- name: Normalize runner architecture (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
$arch = "${{ runner.arch }}".ToLower()
echo "ARCH=$arch" | Out-File $env:GITHUB_ENV -Append
- name: Set cache OS suffix for Linux
if: runner.os == 'Linux'
shell: bash
run: echo "CACHE_OS_SUFFIX=$ImageOS-" >> $GITHUB_ENV
- name: Restore Go cache
id: go-cache
uses: actions/cache/restore@v5
with:
path: |
${{ env.GO_MOD_CACHE }}
${{ env.GO_BUILD_CACHE }}
key: setup-go-${{ runner.os }}-${{ env.ARCH }}-${{ env.CACHE_OS_SUFFIX }}go-${{ steps.setup-go.outputs.go-version }}-${{ hashFiles('**/go.sum') }}
- name: Download modules
run: go mod download
- name: Build
run: go build ./...
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
go-version: ['1.21', '1.22', '1.23']
steps:
- uses: actions/checkout@v5
- uses: actions/setup-go@v6
with:
go-version: ${{ matrix.go-version }}
- run: go test ./...1.23.2
- uses: actions/setup-go@v6
with:
# Version or version range of Go to use
go-version: '1.23'

# Path to go.mod, go.work, .go-version, or .tool-versions file
go-version-file: 'go.mod'

# Check for latest version
check-latest: false

# GitHub token for authentication
token: ${{ github.token }}

# Enable/disable caching
cache: true

# Path to dependency files for caching
cache-dependency-path: 'go.sum'

# Architecture to install (auto-detected if not specified)
architecture: 'x64'
uses: actions/setup-go@v6
with:
token: ${{ secrets.GH_DOTCOM_TOKEN }}
go-version: '1.23'
permissions:
contents: read # Required to checkout code and install dependencies

Copy link

Copilot AI Jan 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The entire workflow file has a fundamentally broken structure. It appears to be a collection of disconnected examples and code snippets rather than a valid GitHub Actions workflow. The file mixes actual workflow configuration (lines 1-28), floating step definitions without job containers, JavaScript code examples, duplicate job declarations, and improperly formatted documentation. The workflow needs to be completely restructured with proper YAML hierarchy: a single jobs section containing job definitions, each with runs-on and steps properties.

Copilot uses AI. Check for mistakes.
Comment on lines +29 to +68
steps:
- uses: actions/checkout@v5
- uses: actions/setup-go@v6
with:
go-version: '1.23'
- run: go version
go 1.23.0 // Minimum required version
toolchain go1.23.2 // V6 uses this exact version
steps:
- uses: actions/checkout@v5
- uses: actions/setup-go@v6
with:
go-version: '1.23'
- run: go run hello.go
steps:
- uses: actions/checkout@v5
- uses: actions/setup-go@v6
with:
steps:
- uses: actions/checkout@v5
- uses: actions/setup-go@v6
with:
go-version: '>=1.22.0'
- run: go version
go-version: '^1.23.1' # The Go version to download (if necessary) and use.
- run: go version
go-version: '1.22' # Correct
go-version: 1.22 # Incorrect - YAML parser interprets as 1.2
# RC version
steps:
- uses: actions/checkout@v5
- uses: actions/setup-go@v6
with:
go-version: '1.24.0-rc.1' # The Go version to download (if necessary) and use
- run: go version
# Beta version
steps:
- uses: actions/checkout@v5
- uses: actions/setup-go@v6
with:
Copy link

Copilot AI Jan 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These lines contain workflow step configuration that is not properly structured within a job. The "steps:" keyword at line 29 appears to be floating without a parent job definition, and the subsequent step definitions (lines 30-34) are not properly indented or organized within the workflow structure. This is invalid YAML for GitHub Actions workflows.

Suggested change
steps:
- uses: actions/checkout@v5
- uses: actions/setup-go@v6
with:
go-version: '1.23'
- run: go version
go 1.23.0 // Minimum required version
toolchain go1.23.2 // V6 uses this exact version
steps:
- uses: actions/checkout@v5
- uses: actions/setup-go@v6
with:
go-version: '1.23'
- run: go run hello.go
steps:
- uses: actions/checkout@v5
- uses: actions/setup-go@v6
with:
steps:
- uses: actions/checkout@v5
- uses: actions/setup-go@v6
with:
go-version: '>=1.22.0'
- run: go version
go-version: '^1.23.1' # The Go version to download (if necessary) and use.
- run: go version
go-version: '1.22' # Correct
go-version: 1.22 # Incorrect - YAML parser interprets as 1.2
# RC version
steps:
- uses: actions/checkout@v5
- uses: actions/setup-go@v6
with:
go-version: '1.24.0-rc.1' # The Go version to download (if necessary) and use
- run: go version
# Beta version
steps:
- uses: actions/checkout@v5
- uses: actions/setup-go@v6
with:
- uses: actions/checkout@v5
- uses: actions/setup-go@v6
with:

Copilot uses AI. Check for mistakes.
Comment on lines +35 to +36
go 1.23.0 // Minimum required version
toolchain go1.23.2 // V6 uses this exact version
Copy link

Copilot AI Jan 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These lines appear to be comments or documentation examples but are not properly formatted as YAML comments. Lines 35-36 should be prefixed with '#' to be valid comments, otherwise they will cause YAML parsing errors.

Suggested change
go 1.23.0 // Minimum required version
toolchain go1.23.2 // V6 uses this exact version
# go 1.23.0 // Minimum required version
# toolchain go1.23.2 // V6 uses this exact version

Copilot uses AI. Check for mistakes.
- uses: actions/setup-go@v6
with:
go-version: ${{ matrix.go-version }}
- run: go test ./...1.23.2
Copy link

Copilot AI Jan 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This run command is malformed. Line 204 shows "go test ./...1.23.2" which appears to have the version number appended directly to the test path. This should likely be "go test ./..." on a separate line from any version specification.

Suggested change
- run: go test ./...1.23.2
- run: go test ./...

Copilot uses AI. Check for mistakes.
Comment on lines +29 to +68
steps:
- uses: actions/checkout@v5
- uses: actions/setup-go@v6
with:
go-version: '1.23'
- run: go version
go 1.23.0 // Minimum required version
toolchain go1.23.2 // V6 uses this exact version
steps:
- uses: actions/checkout@v5
- uses: actions/setup-go@v6
with:
go-version: '1.23'
- run: go run hello.go
steps:
- uses: actions/checkout@v5
- uses: actions/setup-go@v6
with:
steps:
- uses: actions/checkout@v5
- uses: actions/setup-go@v6
with:
go-version: '>=1.22.0'
- run: go version
go-version: '^1.23.1' # The Go version to download (if necessary) and use.
- run: go version
go-version: '1.22' # Correct
go-version: 1.22 # Incorrect - YAML parser interprets as 1.2
# RC version
steps:
- uses: actions/checkout@v5
- uses: actions/setup-go@v6
with:
go-version: '1.24.0-rc.1' # The Go version to download (if necessary) and use
- run: go version
# Beta version
steps:
- uses: actions/checkout@v5
- uses: actions/setup-go@v6
with:
Copy link

Copilot AI Jan 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These step definitions are not properly organized within a job structure. Each "steps:" block (lines 37, 43, 47, etc.) should be part of a job definition with a job name and "runs-on" specification. These floating step blocks will cause workflow validation to fail.

Suggested change
steps:
- uses: actions/checkout@v5
- uses: actions/setup-go@v6
with:
go-version: '1.23'
- run: go version
go 1.23.0 // Minimum required version
toolchain go1.23.2 // V6 uses this exact version
steps:
- uses: actions/checkout@v5
- uses: actions/setup-go@v6
with:
go-version: '1.23'
- run: go run hello.go
steps:
- uses: actions/checkout@v5
- uses: actions/setup-go@v6
with:
steps:
- uses: actions/checkout@v5
- uses: actions/setup-go@v6
with:
go-version: '>=1.22.0'
- run: go version
go-version: '^1.23.1' # The Go version to download (if necessary) and use.
- run: go version
go-version: '1.22' # Correct
go-version: 1.22 # Incorrect - YAML parser interprets as 1.2
# RC version
steps:
- uses: actions/checkout@v5
- uses: actions/setup-go@v6
with:
go-version: '1.24.0-rc.1' # The Go version to download (if necessary) and use
- run: go version
# Beta version
steps:
- uses: actions/checkout@v5
- uses: actions/setup-go@v6
with:
- uses: actions/checkout@v5
- uses: actions/setup-go@v6
with:

Copilot uses AI. Check for mistakes.
Comment on lines +29 to +74
steps:
- uses: actions/checkout@v5
- uses: actions/setup-go@v6
with:
go-version: '1.23'
- run: go version
go 1.23.0 // Minimum required version
toolchain go1.23.2 // V6 uses this exact version
steps:
- uses: actions/checkout@v5
- uses: actions/setup-go@v6
with:
go-version: '1.23'
- run: go run hello.go
steps:
- uses: actions/checkout@v5
- uses: actions/setup-go@v6
with:
steps:
- uses: actions/checkout@v5
- uses: actions/setup-go@v6
with:
go-version: '>=1.22.0'
- run: go version
go-version: '^1.23.1' # The Go version to download (if necessary) and use.
- run: go version
go-version: '1.22' # Correct
go-version: 1.22 # Incorrect - YAML parser interprets as 1.2
# RC version
steps:
- uses: actions/checkout@v5
- uses: actions/setup-go@v6
with:
go-version: '1.24.0-rc.1' # The Go version to download (if necessary) and use
- run: go version
# Beta version
steps:
- uses: actions/checkout@v5
- uses: actions/setup-go@v6
with:
go-version: '1.23.0-beta.1' # The Go version to download (if necessary) and use
- run: go version
steps:
- uses: actions/checkout@v5
- uses: actions/setup-go@v6
with:
Copy link

Copilot AI Jan 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These lines contain inconsistent YAML formatting. Line 53 appears to be a property assignment continuing from above but is improperly placed. Line 54 is an orphaned "- run:" command. Lines 55-56 are documentation comments that should be prefixed with '#'. This entire section lacks proper structure.

Suggested change
steps:
- uses: actions/checkout@v5
- uses: actions/setup-go@v6
with:
go-version: '1.23'
- run: go version
go 1.23.0 // Minimum required version
toolchain go1.23.2 // V6 uses this exact version
steps:
- uses: actions/checkout@v5
- uses: actions/setup-go@v6
with:
go-version: '1.23'
- run: go run hello.go
steps:
- uses: actions/checkout@v5
- uses: actions/setup-go@v6
with:
steps:
- uses: actions/checkout@v5
- uses: actions/setup-go@v6
with:
go-version: '>=1.22.0'
- run: go version
go-version: '^1.23.1' # The Go version to download (if necessary) and use.
- run: go version
go-version: '1.22' # Correct
go-version: 1.22 # Incorrect - YAML parser interprets as 1.2
# RC version
steps:
- uses: actions/checkout@v5
- uses: actions/setup-go@v6
with:
go-version: '1.24.0-rc.1' # The Go version to download (if necessary) and use
- run: go version
# Beta version
steps:
- uses: actions/checkout@v5
- uses: actions/setup-go@v6
with:
go-version: '1.23.0-beta.1' # The Go version to download (if necessary) and use
- run: go version
steps:
- uses: actions/checkout@v5
- uses: actions/setup-go@v6
with:
# ---------------------------------------------------------------------------
# The following are example snippets for actions/setup-go usage.
# They are kept here as documentation only and are not part of this workflow.
#
# steps:
# - uses: actions/checkout@v5
# - uses: actions/setup-go@v6
# with:
# go-version: '1.23'
# - run: go version
# # go 1.23.0 // Minimum required version
# # toolchain go1.23.2 // V6 uses this exact version
#
# steps:
# - uses: actions/checkout@v5
# - uses: actions/setup-go@v6
# with:
# go-version: '1.23'
# - run: go run hello.go
#
# steps:
# - uses: actions/checkout@v5
# - uses: actions/setup-go@v6
# with:
# go-version: '>=1.22.0'
# - run: go version
# # go-version: '^1.23.1' # The Go version to download (if necessary) and use.
# # go-version: '1.22' # Correct
# # go-version: 1.22 # Incorrect - YAML parser interprets as 1.2
#
# # RC version
# steps:
# - uses: actions/checkout@v5
# - uses: actions/setup-go@v6
# with:
# go-version: '1.24.0-rc.1' # The Go version to download (if necessary) and use
# - run: go version
#
# # Beta version
# steps:
# - uses: actions/checkout@v5
# - uses: actions/setup-go@v6
# with:
# go-version: '1.23.0-beta.1' # The Go version to download (if necessary) and use
# - run: go version
steps:
- uses: actions/checkout@v5
- uses: actions/setup-go@v6
with:

Copilot uses AI. Check for mistakes.
with:
go-version: '1.24.0-rc.1' # The Go version to download (if necessary) and use
- run: go version
# Beta version
Copy link

Copilot AI Jan 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment at line 64 is not properly formatted. It appears to be attempting to describe what comes next, but comments in YAML must start with '#'. Line 64 should be "# Beta version" instead of " # Beta version" (note the indentation issue).

Suggested change
# Beta version
# Beta version

Copilot uses AI. Check for mistakes.
Comment on lines +121 to +138
const cache = require('@actions/cache');
const paths = [
'node_modules',
'packages/*/node_modules/'
]
const key = 'npm-foobar-d5ea0750'
const cacheId = await cache.saveCache(paths, key)
const cache = require('@actions/cache');
const paths = [
'node_modules',
'packages/*/node_modules/'
]
const key = 'npm-foobar-d5ea0750'
const restoreKeys = [
'npm-foobar-',
'npm-'
]
const cacheKey = await cache.restoreCache(paths, key, restoreKeys)
Copy link

Copilot AI Jan 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These lines contain JavaScript/Node.js code snippets in the middle of a GitHub Actions YAML workflow file. This code (lines 121-138) appears to be documentation examples showing how to use the @actions/cache library, but it's not properly formatted as comments or code blocks. This will cause YAML parsing to fail.

Copilot uses AI. Check for mistakes.
'npm-'
]
const cacheKey = await cache.restoreCache(paths, key, restoreKeys)
# In some workflows, you may want to restore a cache without saving it. This can help reduce cache writes and storage usage in workflows that only need to read from cache
Copy link

Copilot AI Jan 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment line is not properly formatted as a YAML comment within the workflow. The text at line 139 should either be prefixed with '#' or removed, as it will cause parsing issues in the workflow file.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant