Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: improve CI by making it a workflow graph #4959

Merged
merged 4 commits into from
May 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/actions/prepare-build/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: "Prepare: Build"
description: "Prepares the repo for a job by running the build"
# inputs: - no inputs
# outputs: - no outputs

runs:
using: "composite"
steps:
- uses: actions/cache@v3
id: build-cache
with:
path: "**/dist/**"
key: ${{ runner.os }}-build-${{ github.ref }}
restore-keys: |
${{ runner.os }}-build-

# if the cache was hit - this will run in <1s
- name: Build
shell: bash
# Website will be built by the Netlify GitHub App
run: |
yarn build --exclude website
39 changes: 39 additions & 0 deletions .github/actions/prepare-install/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: "Prepare: Checkout and Install"
description: "Prepares the repo for a job by checking out and installing dependencies"
inputs:
node-version:
description: "The node version to setup"
required: true
# outputs: - no outputs

runs:
using: "composite"
steps:
- name: echo github.ref
shell: bash
run: echo ${{ github.ref }}

- name: Use Node.js ${{ inputs.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ inputs.node-version }}

- name: Get yarn cache directory path
shell: bash
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- uses: actions/cache@v3
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-

# if the cache was hit - this will run in <1s
- name: Install dependencies
shell: bash
run: |
yarn --ignore-engines --frozen-lockfile --ignore-scripts
yarn check-clean-workspace-after-install
Loading