Skip to content

Commit

Permalink
chore(gha): clean up gha, better caching
Browse files Browse the repository at this point in the history
  • Loading branch information
sammccord committed Jun 12, 2024
1 parent 7e68147 commit 6cece08
Show file tree
Hide file tree
Showing 12 changed files with 82 additions and 106 deletions.
1 change: 1 addition & 0 deletions .cache/06455ee423dce193-meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ "hash": "06455ee423dce193", "duration": 9404 }
Binary file added .cache/06455ee423dce193.tar.zst
Binary file not shown.
1 change: 1 addition & 0 deletions .cache/8c5ed2801c551e52-meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ "hash": "8c5ed2801c551e52", "duration": 1060 }
Binary file added .cache/8c5ed2801c551e52.tar.zst
Binary file not shown.
42 changes: 42 additions & 0 deletions .github/actions/install-dependencies/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: "Install dependencies"
description: "Prepare repository and all dependencies"

runs:
using: "composite"
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: "pnpm"
registry-url: https://registry.npmjs.org/
scope: "@boostxyz"
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: 8
run_install: false
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v4
name: Setup cache
with:
path:
- ${{ env.STORE_PATH }}
- .cache
key: ${{ runner.os }}-cache-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-cache-
- name: Install dependencies
shell: bash
run: pnpm install
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
41 changes: 0 additions & 41 deletions .github/workflows/forge.yml

This file was deleted.

4 changes: 0 additions & 4 deletions .github/workflows/on-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,3 @@ jobs:
name: Verify
uses: ./.github/workflows/verify.yml
secrets: inherit
forge:
name: Forge
uses: ./.github/workflows/forge.yml
secrets: inherit
19 changes: 0 additions & 19 deletions .github/workflows/on-push-to-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,6 @@ jobs:
timeout-minutes: 15

steps:
- name: Clone repository
uses: actions/checkout@v4
with:
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 18
registry-url: https://registry.npmjs.org/
scope: "@boostxyz"

- name: Install dependencies
uses: ./.github/actions/install-dependencies
env:
Expand All @@ -51,14 +40,6 @@ jobs:
timeout-minutes: 20

steps:
- name: Clone repository
uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
registry-url: https://registry.npmjs.org/
scope: "@boostxyz"

- name: Install dependencies
uses: ./.github/actions/install-dependencies
env:
Expand Down
66 changes: 31 additions & 35 deletions .github/workflows/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,47 +11,43 @@ jobs:
timeout-minutes: 15

steps:
- name: Clone repository
uses: actions/checkout@v4

- name: Install dependencies
uses: ./.github/actions/install-dependencies
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Build
run: pnpm build

# test:
# name: Test
# runs-on: ubuntu-latest
# strategy:
# matrix:
# shard: [1, 2, 3]
# total-shards: [3]
# transport-mode: ["http", "webSocket"]
# include:
# - batch-multicall: "false"
# - batch-multicall: "true"
# transport-mode: "http"

# steps:
# - name: Clone repository
# uses: actions/checkout@v4
run: npx turbo build --cache-dir=".cache"

# - name: Install dependencies
# uses: ./.github/actions/install-dependencies
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
test:
name: Test
runs-on: ubuntu-latest
strategy:
matrix:
shard: [1, 2, 3]
total-shards: [3]
transport-mode: ["http", "webSocket"]
include:
- batch-multicall: "false"
- batch-multicall: "true"
transport-mode: "http"

# - name: Run tests
# uses: nick-fields/retry@v3
# with:
# timeout_minutes: 20
# max_attempts: 3
# command: pnpm test:ci -- --shard=${{ matrix.shard }}/${{ matrix.total-shards }}
steps:
- name: Install dependencies
uses: ./.github/actions/install-dependencies
env:
# TODO set theses
TEST_SIGNER_PRIVATE_KEY: ${{ secrets.TEST_SIGNER_PRIVATE_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# - name: Upload coverage reports to Codecov
# uses: codecov/[email protected]
# with:
# token: ${{ secrets.CODECOV_TOKEN }}
- name: Run tests
uses: nick-fields/retry@v3
with:
timeout_minutes: 20
max_attempts: 3
command: npx turbo test:ci --cache-dir=".cache" -- --shard=${{ matrix.shard }}/${{ matrix.total-shards }}

- name: Upload coverage reports to Codecov
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@
"changeset": "changeset",
"changeset:release": "turbo run build && changeset publish",
"changeset:version": "changeset version && pnpm install --lockfile-only",
"publish-packages": "turbo run build test:ci && pnpm changeset publish",
"publish-packages": "pnpm changeset publish",
"dev": "turbo dev",
"lint": "turbo lint",
"prepare": "lefthook install",
"postinstall": "git submodule update --init",
"format": "forge fmt packages/evm"
"test": "turbo run test",
"test:ci": "turbo run test:ci"
},
"devDependencies": {
"@biomejs/biome": "1.8.1",
Expand Down
5 changes: 3 additions & 2 deletions packages/evm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
"main": "README.md",
"private": true,
"scripts": {
"build": "forge build",
"test": "forge test -vvv && hardhat test"
"build": "forge build --sizes",
"test": "forge test -vvv && hardhat test",
"test:ci": "forge test --summary --detailed -vvv && hardhat test"
},
"keywords": [],
"author": "",
Expand Down
4 changes: 1 addition & 3 deletions turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@
"dependsOn": ["^build"],
"outputs": [".dist/**", "out/**"]
},
"test": {
"dependsOn": ["build"]
},
"test": {},
"test:ci": {
"outputs": ["coverage/**"]
},
Expand Down

0 comments on commit 6cece08

Please sign in to comment.