Skip to content

Commit

Permalink
Merge pull request #100 from storyprotocol/origin/bpolania/workflows
Browse files Browse the repository at this point in the history
Origin/bpolania/workflows
  • Loading branch information
bpolania authored Dec 10, 2024
2 parents 86c8d11 + 22f176d commit d6ee6e0
Show file tree
Hide file tree
Showing 3 changed files with 119 additions and 1 deletion.
60 changes: 60 additions & 0 deletions .github/workflows/reusable-build-integration-test-workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Build and Test

on:
workflow_call:
inputs:
sha:
required: true
type: string
ENVIRONMENT:
required: true
type: string
secrets:
WALLET_PRIVATE_KEY:
required: true
TEST_WALLET_ADDRESS:
required: true

jobs:
build_and_test:
name: Build and Test
timeout-minutes: 60
runs-on: ubuntu-latest
environment: ${{ inputs.ENVIRONMENT }}
strategy:
fail-fast: false
matrix:
node-version: [20.0.0]
env:
WALLET_PRIVATE_KEY: ${{ secrets.WALLET_PRIVATE_KEY }}
TEST_WALLET_ADDRESS: ${{ secrets.TEST_WALLET_ADDRESS }}

steps:
- name: Check out code
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
with:
ref: ${{ inputs.sha }}

- name: Setup pnpm
uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0
with:
version: 8

- name: Setup Node.js environment
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: ${{ matrix.node-version }}
cache: pnpm

- name: Install dependencies
run: pnpm install

- name: Fix
run: pnpm fix

- name: Test
run: |
npm run test:integration
- name: Build
run: pnpm build
1 change: 0 additions & 1 deletion .github/workflows/reusable-build-test-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ jobs:
name: Build and Test
timeout-minutes: 60
runs-on: ubuntu-latest
## Example to fix envrionment secret not passing in: https://github.com/AllanOricil/workflow-template-bug/blob/master/.github/workflows/workflow-template-fix-without-required-secret.yml
environment: ${{ inputs.ENVIRONMENT }}
strategy:
fail-fast: false
Expand Down
59 changes: 59 additions & 0 deletions .github/workflows/reusable-build-unit-test-workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Build and Test

on:
workflow_call:
inputs:
sha:
required: true
type: string
ENVIRONMENT:
required: true
type: string
secrets:
WALLET_PRIVATE_KEY:
required: true
TEST_WALLET_ADDRESS:
required: true

jobs:
build_and_test:
name: Build and Test
timeout-minutes: 60
runs-on: ubuntu-latest
environment: ${{ inputs.ENVIRONMENT }}
strategy:
fail-fast: false
matrix:
node-version: [20.0.0]
env:
WALLET_PRIVATE_KEY: ${{ secrets.WALLET_PRIVATE_KEY }}
TEST_WALLET_ADDRESS: ${{ secrets.TEST_WALLET_ADDRESS }}

steps:
- name: Check out code
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
with:
ref: ${{ inputs.sha }}

- name: Setup pnpm
uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0
with:
version: 8

- name: Setup Node.js environment
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: ${{ matrix.node-version }}
cache: pnpm

- name: Install dependencies
run: pnpm install

- name: Fix
run: pnpm fix

- name: Test
run: pnpm test

- name: Build
run: pnpm build

0 comments on commit d6ee6e0

Please sign in to comment.