Skip to content

[INTEGRATION LG-3296] Build Pipeline #1812

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

Merged
merged 7 commits into from
Jun 23, 2023
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
165 changes: 15 additions & 150 deletions .github/workflows/nodejs.yml → .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Node.js CI
name: Pull Request CI

on:
pull_request:
Expand All @@ -9,80 +9,9 @@ concurrency:
cancel-in-progress: true

jobs:
install:
name: Install node modules
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v2

- name: Use Node.js 16
uses: actions/setup-node@v3
with:
node-version: '16'
cache: yarn
cache-dependency-path: 'yarn.lock'

- name: Install
run: yarn install --frozen-lockfile --prefer-offline

outputs:
yarn-cache-dir: ${{ steps.get-yarn-cache-dir.outputs.dir }}

lints:
lint:
name: Check lints
runs-on: ubuntu-latest
needs: install
steps:
- uses: actions/checkout@v2

- name: Use Node.js 16
uses: actions/setup-node@v3
with:
node-version: '16'
cache: yarn
cache-dependency-path: 'yarn.lock'

- run: yarn install --frozen-lockfile --prefer-offline

- name: prettier
run: yarn check:prettier

- name: eslint
run: yarn check:eslint --format junit -o reports/junit/js-lint-results.xml

types:
name: Check types
runs-on: ubuntu-latest
needs: install
steps:
- uses: actions/checkout@v2

- name: Use Node.js 16
uses: actions/setup-node@v3
with:
node-version: '16'
cache: yarn
cache-dependency-path: 'yarn.lock'

- run: yarn install --frozen-lockfile --prefer-offline

- uses: actions/cache/restore@v3
name: Restore TS cache
id: ts-cache
with:
path: |
**/dist/**/*.ts
!**/node_modules
key: ${{ runner.os }}-ts-cache-${{ hashFiles('**/tsconfig.js', '**/package.tsconfig.js', '**/src/', '**/scripts/', '!**/node_modules', '!**/dist') }}

- name: types
run: yarn check:ts

deps:
name: Check dependency list
runs-on: ubuntu-latest
needs: install
steps:
- uses: actions/checkout@v2

Expand All @@ -95,16 +24,15 @@ jobs:

- run: yarn install --frozen-lockfile --prefer-offline

- name: deps
run: yarn check:deps
- name: lint
run: yarn lint

- name: package.json versions
run: yarn check:package-json
outputs:
yarn-cache-dir: ${{ steps.get-yarn-cache-dir.outputs.dir }}

build:
name: Build packages
runs-on: ubuntu-latest
needs: [install, lints]
steps:
- uses: actions/checkout@v2

Expand Down Expand Up @@ -132,44 +60,12 @@ jobs:

- name: build
if: ${{ steps.build-cache.outputs.cache-hit != 'true' }}
run: yarn build:packages

build-ts:
name: Build TypeScript
runs-on: ubuntu-latest
needs: [install, lints]
steps:
- uses: actions/checkout@v2

- uses: actions/cache@v3
name: Check for ts cache
id: ts-cache
with:
path: |
**/dist/**/*.ts
!**/node_modules
key: ${{ runner.os }}-ts-cache-${{ hashFiles('**/tsconfig.js', '**/package.tsconfig.js', '**/src/', '**/scripts/', '!**/node_modules', '!**/dist') }}

- name: Use Node.js 16
if: ${{ steps.ts-cache.outputs.cache-hit != 'true' }}
uses: actions/setup-node@v3
with:
node-version: '16'
cache: yarn
cache-dependency-path: 'yarn.lock'

- name: Install
if: ${{ steps.ts-cache.outputs.cache-hit != 'true' }}
run: yarn install --frozen-lockfile --prefer-offline

- name: build-ts
if: ${{ steps.ts-cache.outputs.cache-hit != 'true' }}
run: yarn build:ts
run: yarn build

chromatic:
name: Chromatic
runs-on: ubuntu-latest
needs: [install, build]
needs: [build]
steps:
- name: Checkout
uses: actions/checkout@v2
Expand Down Expand Up @@ -205,7 +101,7 @@ jobs:
tests:
name: Run tests
runs-on: ubuntu-latest
needs: [install, build]
needs: [build]
steps:
- uses: actions/checkout@v2

Expand Down Expand Up @@ -235,7 +131,7 @@ jobs:
tests-ssr:
name: Run tests with artificial server rendering
runs-on: ubuntu-latest
needs: [install, build]
needs: [build]
steps:
- uses: actions/checkout@v2

Expand All @@ -262,10 +158,10 @@ jobs:
env:
JEST_JUNIT_OUTPUT: 'reports/junit/js-test-ssr-results.xml'

checkBuilds:
name: Verify builds
validate-builds:
name: Validate builds & dependencies
runs-on: ubuntu-latest
needs: [install, build, build-ts]
needs: [build]
steps:
- uses: actions/checkout@v2

Expand Down Expand Up @@ -296,36 +192,5 @@ jobs:
!**/node_modules
key: ${{ runner.os }}-ts-cache-${{ hashFiles('**/tsconfig.js', '**/package.tsconfig.js', '**/src/', '**/scripts/', '!**/node_modules', '!**/dist') }}

- name: check builds
run: yarn check:builds

sizeDiff:
name: Check file size
runs-on: ubuntu-latest
needs: install
steps:
- uses: actions/checkout@v2

- name: Use Node.js 16
uses: actions/setup-node@v3
with:
node-version: '16'
cache: yarn
cache-dependency-path: 'yarn.lock'

- run: yarn install --frozen-lockfile --prefer-offline

- uses: actions/cache/restore@v3
name: Restore build cache
id: build-cache
with:
path: |
**/dist
!**/node_modules
key: ${{ runner.os }}-build-cache-${{ hashFiles('**/rollup.config.js', '**/babel.config.js', '**/src/', '**/scripts/', '!**/node_modules', '!**/dist') }}

- uses: preactjs/compressed-size-action@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
clean-script: 'clean:builds && clean:modules'
build-script: 'build:packages'
- name: validate
run: yarn validate
36 changes: 36 additions & 0 deletions .github/workflows/sizeDiff.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: File Size

on:
pull_request:
types: [opened, synchronize, reopened]

jobs:
sizeDiff:
name: Check file size
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Use Node.js 16
uses: actions/setup-node@v3
with:
node-version: '16'
cache: yarn
cache-dependency-path: 'yarn.lock'

- run: yarn install --frozen-lockfile --prefer-offline

- uses: actions/cache/restore@v3
name: Restore build cache
id: build-cache
with:
path: |
**/dist
!**/node_modules
key: ${{ runner.os }}-build-cache-${{ hashFiles('**/rollup.config.js', '**/babel.config.js', '**/src/', '**/scripts/', '!**/node_modules', '!**/dist') }}

- uses: preactjs/compressed-size-action@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
clean-script: 'clean'
build-script: 'build'
20 changes: 0 additions & 20 deletions .github/workflows/test-dispatch.yml

This file was deleted.

3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,6 @@ packages/**/stories.js*

# Storybook/Chromatic logs
build-storybook.log

.turbo
scripts/tmp.*.ts
2 changes: 1 addition & 1 deletion .npmpackagejsonlintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
{
"patterns": ["./packages/code/package.json"],
"rules": {
"prefer-caret-version-dependencies": "warning"
"prefer-caret-version-dependencies": "off"
}
}
]
Expand Down
Loading