setup-go icon indicating copy to clipboard operation
setup-go copied to clipboard

Enhance workflow for Go setup and caching

Open Sawsqr68 opened this issue 1 week ago • 0 comments

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),

Sawsqr68 avatar Jan 09 '26 14:01 Sawsqr68