forked from rancher-sandbox/rancher-desktop
-
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.
CI: factor out
yarn install
dependencies
We have a fixed set of setup we need to do to do `yarn install` (getting NodeJS, golang, and python toolchains; setting up the `M1` flag; etc.). Refactor those into a shared reusable workflow so it will be easier to change in the future. Signed-off-by: Mark Yen <mark.yen@suse.com>
- Loading branch information
Showing
14 changed files
with
77 additions
and
378 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,54 @@ | ||
name: Yarn Install | ||
description: >- | ||
This is a composite action that does everything needed to do `yarn install`. | ||
Checking out the source is optional; however, it must be done before this if | ||
it was disabled. This may be necessary for more complex checkout scenarios. | ||
inputs: | ||
checkout: | ||
description: Whether to check out the repository. | ||
default: 'true' | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- if: inputs.checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
persist-credentials: false | ||
|
||
# In case we're running on a self-hosted runner without `yarn` installed, | ||
# set up NodeJS, enable `yarn`, and then handle the caching. | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version-file: package.json | ||
- run: corepack enable yarn | ||
shell: bash | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version-file: package.json | ||
cache: yarn | ||
|
||
- uses: actions/setup-go@v5 | ||
with: | ||
go-version-file: go.work | ||
cache-dependency-path: src/go/**/go.sum | ||
|
||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.x' | ||
cache: pip | ||
- run: pip install setuptools | ||
shell: bash | ||
|
||
- name: Install Windows dependencies | ||
if: runner.os == 'Windows' | ||
shell: powershell | ||
run: .\scripts\windows-setup.ps1 -SkipVisualStudio -SkipTools | ||
|
||
- name: Flag build for M1 | ||
if: runner.os == 'macOS' && runner.arch == 'ARM64' | ||
run: echo "M1=1" >> "${GITHUB_ENV}" | ||
shell: bash | ||
|
||
- run: yarn install --frozen-lockfile | ||
shell: bash |
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
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
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
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
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
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
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
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
Oops, something went wrong.