Skip to content

Commit

Permalink
ci(package): refactor workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
Rubilmax committed Jul 17, 2024
1 parent b13657b commit cb6577a
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 35 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: actions/checkout@v4

- uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: yarn
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/npm-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: actions/checkout@v4

- uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: yarn
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,56 +11,53 @@ on:

jobs:
build:
name: Build
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: actions/checkout@v4

- uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: yarn

- name: ${{ inputs.name }} build
run: yarn workspace @morpho-org/${{ inputs.name }} build
shell: bash

jest:
name: Unit Tests
runs-on: ubuntu-latest

if: ${{ inputs.jest == true }}
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: actions/checkout@v4

- uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: yarn

- name: Run jest test suite
run: yarn workspace @morpho-org/${{ inputs.name }} jest --passWithNoTests
- run: yarn workspace @morpho-org/${{ inputs.name }} jest --passWithNoTests
shell: bash

hardhat:
name: E2E Tests
runs-on: ubuntu-latest

if: ${{ inputs.hardhat == true }}
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: actions/checkout@v4

- uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: yarn

- name: Restore hardhat cache
uses: actions/cache@v4
- uses: actions/cache@v4
with:
path: packages/${{ inputs.name }}/cache
key: hardhat-${{ inputs.name }}-${{ github.ref_name }}

- name: Run hardhat test suite
run: yarn workspace @morpho-org/${{ inputs.name }} hardhat test --bail
- run: yarn workspace @morpho-org/${{ inputs.name }} hardhat test --bail
shell: bash
env:
MAINNET_RPC_URL: ${{ secrets.MAINNET_RPC_URL }}
21 changes: 5 additions & 16 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,8 @@ jobs:
- name: "@morpho-org/blue-sdk-viem"
hardhat: true

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1
with:
node-version-file: .nvmrc
cache: yarn

- run: yarn install --immutable

- uses: ./.github/workflows/build-test-package.yml
with:
name: ${{ matrix.package.name }}
jest: ${{ matrix.package.jest }}
hardhat: ${{ matrix.package.hardhat }}
uses: ./.github/workflows/package.yml
with:
name: ${{ matrix.package.name }}
jest: ${{ matrix.package.jest }}
hardhat: ${{ matrix.package.hardhat }}

0 comments on commit cb6577a

Please sign in to comment.