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

ci: improve pipelines #2423

Merged
merged 2 commits into from
May 7, 2024
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
14 changes: 8 additions & 6 deletions .github/workflows/code_standard_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@ jobs:
runs-on: ${{ inputs.os }}

steps:
- uses: actions/checkout@v4
- name: Checkout 🛎️
uses: actions/checkout@v4
with:
fetch-depth: 20
fetch-tags: false

- name: Restore cached node modules
- name: Restore cached node modules ♻️
id: cache-yarn
uses: actions/cache@v4
with:
Expand All @@ -36,14 +37,15 @@ jobs:
examples/example-app-yarn-workspace/node_modules
key: ${{ inputs.os }}-${{ inputs.node }}-build-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-${{ inputs.node }}-build
${{ inputs.os }}-${{ inputs.node }}-build

- uses: actions/setup-node@v4
- name: Setup Node version ⚙️
uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node }}

- name: Run ESLint check
- name: Run ESLint check 🔍️
run: yarn lint

- name: Run Prettier check
- name: Run Prettier check 🔍️
run: yarn lint-prettier-ci
52 changes: 0 additions & 52 deletions .github/workflows/doc-generator.yml

This file was deleted.

89 changes: 89 additions & 0 deletions .github/workflows/doc_ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: Documentation CI

on:
push:
branches:
- main
pull_request:
branches:
- '**'
paths:
- 'website/**'
- '.github/**'
- '.yarn/**'
- .yarnrc.yml
- .npmignore
- .gitignore

concurrency:
group: doc-generator-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
checks:
if: github.event_name != 'push'
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v4 # If you're using actions/checkout@v3 you must set persist-credentials to false in most cases for the deployment to work correctly.
with:
persist-credentials: false
fetch-depth: 20
fetch-tags: false

- name: Restore cached node modules ♻️
id: cache-yarn
uses: actions/cache@v4
with:
path: |
website/node_modules
website/.yarn
key: ${{ runner.os }}-build-doc-${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ runner.os }}-build-doc

- name: Install 🔧
if: ${{ steps.cache-yarn.outputs.cache-hit != 'true' }}
run: yarn
working-directory: website

- name: Build 🔨
run: yarn build
working-directory: website

build-and-deploy:
if: github.event_name != 'pull_request'
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v4 # If you're using actions/checkout@v3 you must set persist-credentials to false in most cases for the deployment to work correctly.
with:
persist-credentials: false
fetch-depth: 20
fetch-tags: false

- name: Restore cached node modules ♻️
id: cache-yarn
uses: actions/cache@v4
with:
path: |
website/node_modules
website/.yarn
key: ${{ runner.os }}-build-doc-${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ runner.os }}-build-doc

- name: Install 🔧
if: ${{ steps.cache-yarn.outputs.cache-hit != 'true' }}
run: yarn
working-directory: website

- name: Build 🔨
run: yarn build
working-directory: website

- name: Deploy 🚀
uses: JamesIves/[email protected]
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages # The branch the action should deploy to.
FOLDER: website/build # The folder the action should deploy.
CLEAN: true # Automatically remove deleted files from the deploy branch
12 changes: 7 additions & 5 deletions .github/workflows/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,13 @@ jobs:
runs-on: ${{ inputs.os }}

steps:
- uses: actions/checkout@v4
- name: Checkout 🛎️
uses: actions/checkout@v4
with:
fetch-depth: 20
fetch-tags: false

- name: Restore cached node modules
- name: Restore cached node modules ♻️
id: cache-yarn
uses: actions/cache@v4
with:
Expand All @@ -37,14 +38,15 @@ jobs:
examples/example-app-yarn-workspace/node_modules
key: ${{ inputs.os }}-${{ inputs.node }}-build-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-${{ inputs.node }}-build
${{ inputs.os }}-${{ inputs.node }}-build

- uses: actions/setup-node@v4
- name: Setup Node version ⚙️
uses: actions/setup-node@v4
if: ${{ steps.cache-yarn.outputs.cache-hit != 'true' }}
with:
node-version: ${{ inputs.node }}

- name: Install dependencies
- name: Install 🔧
if: ${{ steps.cache-yarn.outputs.cache-hit != 'true' }}
run: |
yarn --immutable
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
name: CI
name: Source codes CI

on:
push:
branches:
- main
paths-ignore:
- 'website/**'
pull_request:
branches:
- '**'
paths-ignore:
- 'website/**'

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
Expand Down
14 changes: 8 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@ jobs:
runs-on: ${{ inputs.os }}

steps:
- uses: actions/checkout@v4
- name: Checkout 🛎️
uses: actions/checkout@v4
with:
fetch-depth: 20
fetch-tags: false

- name: Restore cached node modules
- name: Restore cached node modules ♻️
id: cache-yarn
uses: actions/cache@v4
with:
Expand All @@ -36,14 +37,15 @@ jobs:
examples/example-app-yarn-workspace/node_modules
key: ${{ inputs.os }}-${{ inputs.node }}-build-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-${{ inputs.node }}-build
${{ inputs.os }}-${{ inputs.node }}-build

- uses: actions/setup-node@v4
- name: Setup Node version ⚙️
uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node }}

- name: Run tests
- name: Run tests 🧪
run: yarn test

- name: Run tests in example projects
- name: Run tests in example projects 🧪
run: yarn test-examples