Skip to content

Commit

Permalink
fix(workflow): fix a solidity workflow error (#12136)
Browse files Browse the repository at this point in the history
* fix(workflow): fix a solidity workflow error

* chore: update workflow
  • Loading branch information
davidtaikocha authored Jan 9, 2023
1 parent 04d3772 commit 2b4cd56
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 368 deletions.
35 changes: 35 additions & 0 deletions .github/actions/set-up-protocol/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: 'Set Up Protocol'
description: 'Set up protocol dependencies'

runs:
using: "composite"
steps:
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 16

- name: Install pnpm
uses: pnpm/action-setup@v2
id: pnpm-install
with:
version: 7
run_install: false

- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- name: Setup pnpm cache
uses: actions/cache@v3
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
shell: bash
run: pnpm install
49 changes: 12 additions & 37 deletions .github/workflows/solidity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,50 +10,20 @@ on:
- "packages/protocol/**"

jobs:
setup:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 16

- name: Install pnpm
uses: pnpm/action-setup@v2
id: pnpm-install
with:
version: 7
run_install: false

- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- name: Setup pnpm cache
uses: actions/cache@v3
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install

build:
needs: setup
runs-on: ubuntu-latest
steps:
- name: Cancel previous runs
uses: styfle/cancel-workflow-action@0.11.0
with:
access_token: ${{ github.token }}

- name: Checkout repository
uses: actions/checkout@v3

- name: Set up protocol
uses: ./.github/actions/set-up-protocol

- name: protocol - Unit Tests
working-directory: ./packages/protocol
run: pnpm clean && pnpm test
Expand Down Expand Up @@ -85,10 +55,15 @@ jobs:
flags: protocol

post-merge:
needs: setup
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up protocol
uses: ./.github/actions/set-up-protocol

- name: Run the command to update the documentation
run: pnpm -F protocol export:docs

Expand Down
Loading

0 comments on commit 2b4cd56

Please sign in to comment.