forked from ethereumbook/ethereumbook
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c5ddebd
commit 48b4562
Showing
1 changed file
with
142 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,142 @@ | ||
name: NodeJS with Webpack | ||
|
||
on: | ||
push: | ||
branches: [ "develop" ] | ||
pull_request: | ||
branches: [ "develop" ] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
node-version: [18.x, 20.x, 22.x] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
|
||
- name: Build | ||
run: | | ||
npm install | ||
npx webpack | ||
- name: Cache | ||
uses: actions/[email protected] | ||
with: | ||
# A list of files, directories, and wildcard patterns to cache and restore | ||
path: | ||
# An explicit key for restoring and saving the cache | ||
key: | ||
# An ordered multiline string listing the prefix-matched keys, that are used for restoring stale cache if no cache hit occurred for key. Note `cache-hit` returns false in this case. | ||
restore-keys: # optional | ||
# The chunk size used to split up large files during upload, in bytes | ||
upload-chunk-size: # optional | ||
# An optional boolean when enabled, allows windows runners to save or restore caches that can be restored or saved respectively on other platforms | ||
enableCrossOsArchive: # optional, default is false | ||
# Fail the workflow if cache entry is not found | ||
fail-on-cache-miss: # optional, default is false | ||
# Check if a cache entry exists for the given input(s) (key, restore-keys) without downloading the cache | ||
lookup-only: # optional, default is false | ||
# Run the post step to save the cache even if another step before fails | ||
save-always: # optional, default is false | ||
- name: Setup Node.js environment | ||
uses: actions/[email protected] | ||
with: | ||
# Set always-auth in npmrc. | ||
always-auth: # optional, default is false | ||
# Version Spec of the version to use. Examples: 12.x, 10.15.1, >=10.15.0. | ||
node-version: # optional | ||
# File containing the version Spec of the version to use. Examples: package.json, .nvmrc, .node-version, .tool-versions. | ||
node-version-file: # optional | ||
# Target architecture for Node to use. Examples: x86, x64. Will use system architecture by default. | ||
architecture: # optional | ||
# Set this option if you want the action to check for the latest available version that satisfies the version spec. | ||
check-latest: # optional | ||
# Optional registry to set up for auth. Will set the registry in a project level .npmrc and .yarnrc file, and set up auth to read in from env.NODE_AUTH_TOKEN. | ||
registry-url: # optional | ||
# Optional scope for authenticating against scoped registries. Will fall back to the repository owner when using the GitHub Packages registry (https://npm.pkg.github.com/). | ||
scope: # optional | ||
# Used to pull node distributions from node-versions. Since there's a default, this is typically not supplied by the user. When running this action on github.com, the default value is sufficient. When running on GHES, you can pass a personal access token for github.com if you are experiencing rate limiting. | ||
token: # optional, default is ${{ github.server_url == 'https://github.com' && github.token || '' }} | ||
# Used to specify a package manager for caching in the default directory. Supported values: npm, yarn, pnpm. | ||
cache: # optional | ||
# Used to specify the path to a dependency file: package-lock.json, yarn.lock, etc. Supports wildcards or a list of file names for caching multiple dependencies. | ||
cache-dependency-path: # optional | ||
- name: Setup Java JDK | ||
uses: actions/[email protected] | ||
with: | ||
# The Java version to set up. Takes a whole or semver Java version. See examples of supported syntax in README file | ||
java-version: # optional | ||
# The path to the `.java-version` file. See examples of supported syntax in README file | ||
java-version-file: # optional | ||
# Java distribution. See the list of supported distributions in README file | ||
distribution: | ||
# The package type (jdk, jre, jdk+fx, jre+fx) | ||
java-package: # optional, default is jdk | ||
# The architecture of the package (defaults to the action runner's architecture) | ||
architecture: # optional | ||
# Path to where the compressed JDK is located | ||
jdkFile: # optional | ||
# Set this option if you want the action to check for the latest available version that satisfies the version spec | ||
check-latest: # optional | ||
# ID of the distributionManagement repository in the pom.xml file. Default is `github` | ||
server-id: # optional, default is github | ||
# Environment variable name for the username for authentication to the Apache Maven repository. Default is $GITHUB_ACTOR | ||
server-username: # optional, default is GITHUB_ACTOR | ||
# Environment variable name for password or token for authentication to the Apache Maven repository. Default is $GITHUB_TOKEN | ||
server-password: # optional, default is GITHUB_TOKEN | ||
# Path to where the settings.xml file will be written. Default is ~/.m2. | ||
settings-path: # optional | ||
# Overwrite the settings.xml file if it exists. Default is "true". | ||
overwrite-settings: # optional, default is true | ||
# GPG private key to import. Default is empty string. | ||
gpg-private-key: # optional | ||
# Environment variable name for the GPG private key passphrase. Default is $GPG_PASSPHRASE. | ||
gpg-passphrase: # optional | ||
# Name of the build platform to cache dependencies. It can be "maven", "gradle" or "sbt". | ||
cache: # optional | ||
# The path to a dependency file: pom.xml, build.gradle, build.sbt, etc. This option can be used with the `cache` option. If this option is omitted, the action searches for the dependency file in the entire repository. This option supports wildcards and a list of file names for caching multiple dependencies. | ||
cache-dependency-path: # optional | ||
# Workaround to pass job status to post job step. This variable is not intended for manual setting | ||
job-status: # optional, default is ${{ job.status }} | ||
# The token used to authenticate when fetching version manifests hosted on github.com, such as for the Microsoft Build of OpenJDK. When running this action on github.com, the default value is sufficient. When running on GHES, you can pass a personal access token for github.com if you are experiencing rate limiting. | ||
token: # optional, default is ${{ github.server_url == 'https://github.com' && github.token || '' }} | ||
# Name of Maven Toolchain ID if the default name of "${distribution}_${java-version}" is not wanted. See examples of supported syntax in Advanced Usage file | ||
mvn-toolchain-id: # optional | ||
# Name of Maven Toolchain Vendor if the default name of "${distribution}" is not wanted. See examples of supported syntax in Advanced Usage file | ||
mvn-toolchain-vendor: # optional | ||
- name: Download a Build Artifact | ||
uses: actions/[email protected] | ||
with: | ||
# Name of the artifact to download. If unspecified, all artifacts for the run are downloaded. | ||
name: # optional | ||
# Destination path. Supports basic tilde expansion. Defaults to $GITHUB_WORKSPACE | ||
path: # optional | ||
# A glob pattern matching the artifacts that should be downloaded. Ignored if name is specified. | ||
pattern: # optional | ||
# When multiple artifacts are matched, this changes the behavior of the destination directories. If true, the downloaded artifacts will be in the same directory specified by path. If false, the downloaded artifacts will be extracted into individual named directories within the specified path. | ||
merge-multiple: # optional, default is false | ||
# The GitHub token used to authenticate with the GitHub API. This is required when downloading artifacts from a different repository or from a different workflow run. If this is not specified, the action will attempt to download artifacts from the current repository and the current workflow run. | ||
github-token: # optional | ||
# The repository owner and the repository name joined together by "/". If github-token is specified, this is the repository that artifacts will be downloaded from. | ||
repository: # optional, default is ${{ github.repository }} | ||
# The id of the workflow run where the desired download artifact was uploaded from. If github-token is specified, this is the run that artifacts will be downloaded from. | ||
run-id: # optional, default is ${{ github.run_id }} | ||
- name: First interaction | ||
uses: actions/[email protected] | ||
with: | ||
# Token for the repository. Can be passed in using {{ secrets.GITHUB_TOKEN }} | ||
repo-token: | ||
# Comment to post on an individual's first issue | ||
issue-message: # optional | ||
# Comment to post on an individual's first pull request | ||
pr-message: # optional | ||
|
||
|
||
|