Skip to content

Commit

Permalink
Try leveraging changesets in node workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
yorhodes committed Nov 21, 2023
1 parent 0c65055 commit c2b1d16
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 64 deletions.
77 changes: 13 additions & 64 deletions .github/workflows/node.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ jobs:
needs: [yarn-install]
steps:
- uses: actions/checkout@v3
with:
submodules: recursive

- uses: actions/setup-node@v3
with:
node-version: 18
Expand All @@ -71,6 +70,10 @@ jobs:
needs: [yarn-install]
steps:
- uses: actions/checkout@v3
with:
# check out full history
fetch-depth: 0

- uses: actions/cache@v3
with:
path: |
Expand All @@ -90,27 +93,25 @@ jobs:
exit 1
fi
test-ts:
test:
runs-on: ubuntu-latest
needs: [yarn-build]
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0

- name: Install Foundry
uses: onbjerg/foundry-toolchain@v1

- uses: actions/cache@v3
with:
path: ./*
key: ${{ github.sha }}

- name: sdk
run: yarn workspace @hyperlane-xyz/sdk run test

- name: helloworld
run: yarn workspace @hyperlane-xyz/helloworld run test

- name: infra
run: yarn workspace @hyperlane-xyz/infra run test
- name: Unit Tests
run: yarn test

test-cli:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -152,59 +153,7 @@ jobs:
- name: Test ${{ matrix.environment }} ${{ matrix.module }} deployment (check, deploy, govern, check again)
run: cd typescript/infra && ./fork.sh ${{ matrix.environment }} ${{ matrix.module }}

test-sol:
env:
ETHERSCAN_API_KEY: ''

runs-on: ubuntu-latest
needs: [yarn-build]

steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: ./*
key: ${{ github.sha }}

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

- name: Install Foundry
uses: onbjerg/foundry-toolchain@v1

- name: Install dependencies
run: cd solidity && forge install

- name: Forge build
run: cd solidity && forge build --build-info

#- name: gas
# run: yarn workspace @hyperlane-xyz/core run gas-ci

- name: Unit tests
run: yarn workspace @hyperlane-xyz/core run test

- name: Static analysis
uses: crytic/slither-action@v0.3.0
id: slither
with:
target: 'solidity/'
slither-config: 'solidity/slither.config.json'
sarif: results.sarif
fail-on: none
ignore-compile: true

- name: Upload SARIF file
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: ${{ steps.slither.outputs.sarif }}

coverage-sol:
coverage:
runs-on: ubuntu-latest
needs: [yarn-build]

Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ jobs:
- name: Checkout Repo
uses: actions/checkout@v3
with:
# check out full history
fetch-depth: 0
submodules: recursive

- name: Setup Node.js 18.x
Expand Down
42 changes: 42 additions & 0 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: static-analysis

on:
# Triggers the workflow on pull request against main
pull_request:
branches: [main]
paths:
- 'solidity/**'

jobs:
slither:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
submodules: recursive

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

- name: Install dependencies
run: cd solidity && yarn install

- name: Static analysis
uses: crytic/slither-action@v0.3.0
id: slither
with:
target: 'solidity/'
slither-config: 'solidity/slither.config.json'
sarif: results.sarif
fail-on: none

- name: Upload SARIF file
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: ${{ steps.slither.outputs.sarif }}

0 comments on commit c2b1d16

Please sign in to comment.