Fix builds and tests

pull/2435/head
Yorke Rhodes 1 year ago
parent d9cd552c62
commit ebaf652192
No known key found for this signature in database
GPG Key ID: 9EEACF1DA75C5627
  1. 99
      .github/workflows/helloworld.yml
  2. 7
      .github/workflows/node.yml
  3. 106
      .github/workflows/token.yml
  4. 2
      package.json
  5. 33
      scripts/sync-submodules.sh
  6. 7
      typescript/helloworld/.yarnrc.yml

@ -1,99 +0,0 @@
name: ci
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [main]
pull_request:
branches: [main]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
install:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: .//node_modules
key: ${{ runner.os }}-yarn-cache-${{ hashFiles('./yarn.lock') }}
- name: yarn-install
# Check out the lockfile from main, reinstall, and then
# verify the lockfile matches what was committed.
run: |
yarn install
CHANGES=$(git status -s)
if [[ ! -z $CHANGES ]]; then
echo "Changes found: $CHANGES"
git diff
exit 1
fi
build:
runs-on: ubuntu-latest
needs: [install]
steps:
- uses: actions/checkout@v2
- name: yarn-cache
uses: actions/cache@v2
with:
path: .//node_modules
key: ${{ runner.os }}-yarn-cache-${{ hashFiles('./yarn.lock') }}
- name: build-cache
uses: actions/cache@v2
with:
path: ./*
key: ${{ github.sha }}
- name: build
run: yarn run build
prettier:
runs-on: ubuntu-latest
needs: [install]
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: .//node_modules
key: ${{ runner.os }}-yarn-cache-${{ hashFiles('./yarn.lock') }}
- name: prettier
run: |
yarn run prettier
CHANGES=$(git status -s)
if [[ ! -z $CHANGES ]]; then
echo "Changes found: $CHANGES"
exit 1
fi
lint:
runs-on: ubuntu-latest
needs: [install]
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: .//node_modules
key: ${{ runner.os }}-yarn-cache-${{ hashFiles('./yarn.lock') }}
- name: lint
run: yarn run lint
test:
runs-on: ubuntu-latest
needs: [build]
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: ./*
key: ${{ github.sha }}
- name: test
run: yarn run test

@ -103,6 +103,13 @@ jobs:
- name: sdk
run: yarn workspace @hyperlane-xyz/sdk run test
- name: helloworld
run: yarn workspace @hyperlane-xyz/helloworld run test
- name: token
run: yarn workspace @hyperlane-xyz/token run test
- name: infra
run: yarn workspace @hyperlane-xyz/infra run test

@ -1,106 +0,0 @@
name: ci
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [main]
pull_request:
branches: [main]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
install:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: .//node_modules
key: ${{ runner.os }}-yarn-cache-${{ hashFiles('./yarn.lock') }}
- name: yarn-install
# Check out the lockfile from main, reinstall, and then
# verify the lockfile matches what was committed.
run: |
yarn install
CHANGES=$(git status -s)
if [[ ! -z $CHANGES ]]; then
echo "Changes found: $CHANGES"
git diff
exit 1
fi
build:
runs-on: ubuntu-latest
needs: [install]
steps:
- uses: actions/checkout@v2
- name: yarn-cache
uses: actions/cache@v2
with:
path: .//node_modules
key: ${{ runner.os }}-yarn-cache-${{ hashFiles('./yarn.lock') }}
- name: build-cache
uses: actions/cache@v2
with:
path: ./*
key: ${{ github.sha }}
- name: build
run: yarn run build
prettier:
runs-on: ubuntu-latest
needs: [install]
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: .//node_modules
key: ${{ runner.os }}-yarn-cache-${{ hashFiles('./yarn.lock') }}
- name: prettier
run: |
yarn run prettier
CHANGES=$(git status -s)
if [[ ! -z $CHANGES ]]; then
echo "Changes found: $CHANGES"
exit 1
fi
lint:
runs-on: ubuntu-latest
needs: [build]
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: ./*
key: ${{ github.sha }}
- name: lint
run: yarn run lint
test:
runs-on: ubuntu-latest
needs: [build]
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: ./*
key: ${{ github.sha }}
- name: test with coverage
run: yarn run coverage
- uses: osmind-development-org/lcov-reporter-action@v0.3.2
with:
title: "Hardhat Coverage Report"
lcov-file: ./coverage/lcov.info
lcov-base: ./lcov.base.info
delete-old-comments: true

@ -16,9 +16,7 @@
"private": true,
"scripts": {
"build": "yarn workspaces foreach --verbose --parallel --topological run build",
"build:e2e": "yarn workspaces foreach --verbose --parallel --exclude @hyperlane-xyz/monorepo --exclude @hyperlane-xyz/hyperlane-token --topological run build",
"clean": "yarn workspaces foreach --verbose --parallel run clean",
"sync-submodules": "./scripts/sync-submodules.sh",
"postinstall": "husky install",
"prettier": "yarn workspaces foreach --verbose --parallel run prettier",
"lint-ts": "eslint . --ext .ts",

@ -1,33 +0,0 @@
#!/usr/bin/env bash
# This is designed to synchronize the typescript submodules in the current state with the committed
# submodule version and then clean and build the typescript codebase. This will not update the
# submodules, only bring them to the same version as they are in `.gitmodules`.
set -e
DIRNAME=$(basename "$PWD")
if [[ "$DIRNAME" != "hyperlane-monorepo" ]]; then
echo "Must be run from the root of the monorepo"
exit 1
fi
DIRS=$(git submodule status | grep -oE "typescript/[a-zA-Z0-9_-]+")
for DIR in $DIRS ; do
echo "Removing '$DIR'"
rm -rf "$DIR"
done
git submodule init
git submodule update
for DIR in $DIRS ; do
echo "Cleaning '$DIR'"
pushd "$DIR" || continue
rm -rf yarn.lock node_modules
popd || exit 1
done
yarn clean
yarn install
yarn build

@ -1,7 +0,0 @@
nodeLinker: node-modules
plugins:
- path: .yarn/plugins/@yarnpkg/plugin-version.cjs
spec: "@yarnpkg/plugin-version"
yarnPath: .yarn/releases/yarn-3.2.0.cjs
Loading…
Cancel
Save