-
Notifications
You must be signed in to change notification settings - Fork 96
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
Showing
3 changed files
with
110 additions
and
147 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,32 @@ | ||
name: "Setup Golang environment" | ||
description: "A reusable workflow that's used to set up the Go environment and cache." | ||
inputs: | ||
go-version: | ||
description: "The version of Golang to set up" | ||
required: true | ||
|
||
runs: | ||
using: "composite" | ||
|
||
steps: | ||
- name: set git config | ||
shell: bash | ||
run: | | ||
git config --global core.eol lf | ||
git config --global core.autocrlf false | ||
- name: setup go ${{ inputs.go-version }} | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: '${{ inputs.go-version }}' | ||
|
||
- name: go cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: /home/runner/work/go | ||
key: litd-${{ runner.os }}-go-${{ inputs.go-version }}-${{ github.job }}-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
litd-${{ runner.os }}-go-${{ inputs.go-version }}-${{ github.job }}-${{ hashFiles('**/go.sum') }} | ||
litd-${{ runner.os }}-go-${{ inputs.go-version }}-${{ github.job }}- | ||
litd-${{ runner.os }}-go-${{ inputs.go-version }}- | ||
litd-${{ runner.os }}-go- |
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,37 @@ | ||
name: "Setup Node environment" | ||
description: "A reusable workflow that's used to set up the Node environment and cache." | ||
inputs: | ||
node-version: | ||
description: "The version of Node to set up" | ||
required: true | ||
|
||
runs: | ||
using: "composite" | ||
|
||
steps: | ||
- name: set git config | ||
shell: bash | ||
run: | | ||
git config --global core.eol lf | ||
git config --global core.autocrlf false | ||
- name: setup nodejs v${{ inputs.node-version }} | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: '${{ inputs.node-version }}' | ||
|
||
- name: get yarn cache dir | ||
id: yarn-cache-dir | ||
shell: bash | ||
run: echo "::set-output name=dir::$(yarn cache dir)" | ||
|
||
- name: yarn cache | ||
uses: actions/cache@v2 | ||
id: yarn-cache | ||
with: | ||
path: ${{ steps.yarn-cache-dir.outputs.dir }} | ||
key: litd-${{ runner.os }}-yarn-${{ inputs.node-version }}-${{ hashFiles('**/yarn.lock') }} | ||
restore-keys: | | ||
litd-${{ runner.os }}-yarn-${{ inputs.node-version }}-${{ hashFiles('**/yarn.lock') }} | ||
litd-${{ runner.os }}-yarn-${{ inputs.node-version }}- | ||
litd-${{ runner.os }}-yarn- |
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