Skip to content

Commit

Permalink
ci: rework ci
Browse files Browse the repository at this point in the history
  • Loading branch information
pczeglik-iohk committed Apr 23, 2024
1 parent 0601346 commit 67eef7b
Show file tree
Hide file tree
Showing 15 changed files with 183 additions and 4 deletions.
15 changes: 15 additions & 0 deletions .github/actions/build/cardano/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: build cardano
description: Build packages/cardano
runs:
using: 'composite'
steps:
- name: Build cardano package
run: yarn build
shell: bash
working-directory: packages/cardano

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: packages-cardano
path: packages/cardano/dist
16 changes: 16 additions & 0 deletions .github/actions/build/common/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: build common
description: Build packages/common
runs:
using: 'composite'
steps:
- name: Build common package
run: yarn build
shell: bash
working-directory: packages/common

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: packages-common
path: packages/common/dist

10 changes: 10 additions & 0 deletions .github/actions/build/core/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: build core
description: Build packages/core
runs:
using: 'composite'
steps:
- name: Build core package
run: yarn build
shell: bash
working-directory: packages/core

16 changes: 16 additions & 0 deletions .github/actions/build/icons/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: build icons
description: Build packages/icons
runs:
using: 'composite'
steps:
- name: Build icons package
run: yarn build
shell: bash
working-directory: packages/icons

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: packages-icons
path: packages/icons/dist

16 changes: 16 additions & 0 deletions .github/actions/build/staking/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: build staking
description: Build packages/staking
runs:
using: 'composite'
steps:
- name: Build staking package
run: yarn build
shell: bash
working-directory: packages/staking

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: packages-staking
path: packages/staking/dist

16 changes: 16 additions & 0 deletions .github/actions/build/ui/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: build ui
description: Build packages/ui
runs:
using: 'composite'
steps:
- name: Build ui package
run: yarn build
shell: bash
working-directory: packages/ui

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: packages-ui
path: packages/ui/dist

22 changes: 22 additions & 0 deletions .github/actions/install/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: setup and install
description: Setup Node.js and install dependencies
runs:
using: 'composite'
steps:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'yarn'

- name: Node modules cache
uses: actions/cache@v4
with:
path: |
node_modules
**/node_modules
key: ${{ runner.os }}-${{ hashFiles('yarn.lock') }}

- name: Install dependencies
run: yarn install --immutable --inline-builds
shell: bash
12 changes: 12 additions & 0 deletions .github/actions/lint/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: lint
description: Format and lint
runs:
using: 'composite'
steps:
- name: Check code formatting
run: yarn format-check
shell: bash

- name: Lint code
run: yarn lint
shell: bash
19 changes: 19 additions & 0 deletions .github/actions/verify/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: test
description: Execute tests
runs:
using: 'composite'
steps:
- name: Decrypt test data
working-directory: ./packages/e2e-tests
run: ./decrypt_secret.sh
shell: bash
env:
WALLET_1_PASSWORD: ${{ secrets.WALLET_PASSWORD_TESTNET }}

- name: Unit tests
run: yarn test --maxWorkers=2 --silent
shell: bash
env:
AVAILABLE_CHAINS: 'Preprod,Preview,Mainnet'
DEFAULT_CHAIN: 'Preprod'
NODE_OPTIONS: '--max_old_space_size=8192'
1 change: 0 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: CI

on:
pull_request:
push:
branches:
- 'release/**'
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/packages-staking.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ name: packages/staking
# 3. Adding "staking" label to Pull Request

on:
pull_request:
push:
branches:
- 'main'
Expand Down
38 changes: 38 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Pull Request

on:
pull_request:

jobs:
validate:
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Node.js and install dependencies
uses: ./.github/actions/install

# - name: Format and lint
# uses: ./.github/actions/lint

- name: Build icons
uses: ./.github/actions/build/icons

- name: Build ui
uses: ./.github/actions/build/ui

- name: Build common
uses: ./.github/actions/build/common

- name: Build cardano
uses: ./.github/actions/build/cardano

- name: Build core
uses: ./.github/actions/build/core

- name: Build staking
uses: ./.github/actions/build/staking

- name: Test
uses: ./.github/actions/verify
1 change: 0 additions & 1 deletion .github/workflows/smoke-tests.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: Smoke Tests

on:
pull_request:
workflow_dispatch:

env:
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"extension:lint": "yarn eslint-cmd \"apps/browser-extension-wallet/**/*.{js,ts,tsx}\"",
"postinstall": "husky install & ts-patch install -s",
"lint": "yarn workspaces foreach -ptv run lint && yarn markdown:lint",
"format-check": "yarn workspaces foreach -ptv run format-check",
"markdown:lint": "markdownlint '{packages,apps}/**/*.md' -p .gitignore",
"markdown:lint:fix": "yarn markdown:lint --fix",
"staking": "APP_NAME=staking yarn $0",
Expand Down
3 changes: 2 additions & 1 deletion packages/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
"build": "run -T rollup -c rollup.config.js",
"build-storybook": "NODE_OPTIONS=--openssl-legacy-provider; build-storybook",
"cleanup": "yarn exec rm -rf dist node_modules",
"format": "yarn prettier --write '**/*.tsx'",
"format": "yarn prettier --write .",
"format-check": "prettier --check .",
"lint": "eslint .",
"storybook": "NODE_OPTIONS=--openssl-legacy-provider; start-storybook -p 6006",
"test": "echo \"@lace/ui: no test specified\"",
Expand Down

0 comments on commit 67eef7b

Please sign in to comment.