Skip to content

Commit 04d2fbb

Browse files
committed
Create CI
1 parent b27235d commit 04d2fbb

File tree

10 files changed

+1619
-4
lines changed

10 files changed

+1619
-4
lines changed

.github/actions/setup/action.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Setup
2+
3+
runs:
4+
using: composite
5+
steps:
6+
- name: Install Node
7+
uses: actions/setup-node@v4
8+
with:
9+
node-version: 18.15
10+
- name: Hash submodule commit
11+
id: hash-submodule
12+
shell: bash
13+
run: echo "$(git submodule status)" >> submodule-hash.txt
14+
- name: Cache node modules
15+
uses: actions/cache@v4
16+
id: cache-modules
17+
with:
18+
path: './node_modules/*'
19+
key: yarn-pool-${{ hashFiles('./yarn.lock') }}
20+
- name: Cache library node modules
21+
uses: actions/cache@v4
22+
id: cache-lib-modules
23+
with:
24+
path: './lib/balancer-v3-monorepo/node_modules/*'
25+
key: lib-${{ hashFiles('./submodule-hash.txt') }}
26+
- name: Cache library artifacts
27+
uses: actions/cache@v4
28+
id: cache-lib-artifacts
29+
with:
30+
path: './lib/balancer-v3-monorepo/pkg/*'
31+
key: lib-${{ hashFiles('./submodule-hash.txt') }}
32+
- name: Install Foundry
33+
uses: foundry-rs/foundry-toolchain@v1
34+
- name: Install lcov
35+
shell: bash
36+
run: sudo apt-get install lcov
37+
- name: Install fresh
38+
shell: bash
39+
run: sh ./scripts/install-fresh.sh
40+
if: steps.cache-lib-artifacts.outputs.cache-hit != 'true' || steps.cache-lib-modules.outputs.cache-hit != 'true'
41+
- name: Yarn
42+
run: yarn --immutable
43+
shell: bash
44+
if: steps.cache-modules.outputs.cache-hit != 'true'

.github/pull_request_template.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Description
2+
3+
<!-- Describe the changes introduced in this pull request. -->
4+
<!-- Include any context necessary for understanding the PR's purpose. -->
5+
6+
## Type of change
7+
8+
- [ ] Bug fix <!-- (non-breaking change which fixes an issue) -->
9+
- [ ] New feature <!-- (non-breaking change which adds functionality) -->
10+
- [ ] Breaking change <!-- (would cause existing functionality to not work as expected) -->
11+
- [ ] Dependency changes
12+
- [ ] Code refactor / cleanup
13+
- [ ] Optimization: [ ] gas / [ ] bytecode
14+
- [ ] Documentation or wording changes
15+
- [ ] Other
16+
17+
## Checklist:
18+
19+
- [ ] The diff is legible and has no extraneous changes
20+
- [ ] Complex code has been commented, including external interfaces
21+
- [ ] Tests have 100% code coverage
22+
- [ ] The base branch is either `main`, or there's a description of how to merge
23+
24+
## Issue Resolution
25+
26+
<!-- If this PR addresses an issue, note that here: e.g., Closes/Fixes/Resolves #1346. -->

.github/workflows/ci.yml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: CI
2+
3+
env:
4+
CI: true
5+
6+
on:
7+
push:
8+
branches:
9+
- main
10+
pull_request:
11+
branches: ['*', '**/*']
12+
13+
jobs:
14+
lint-and-build:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
- name: Set up environment
19+
uses: ./.github/actions/setup
20+
- name: Lint
21+
run: yarn lint
22+
- name: Build
23+
run: yarn build
24+
env:
25+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26+
FORGE_SNAPSHOT_CHECK: true
27+
- uses: actions/upload-artifact@v4
28+
with:
29+
name: built-artifacts
30+
path: artifacts/
31+
- uses: actions/upload-artifact@v4
32+
with:
33+
name: built-lib
34+
path: lib/balancer-v3-monorepo/pkg/
35+
- uses: actions/upload-artifact@v4
36+
with:
37+
name: built-lib-pvt
38+
path: lib/balancer-v3-monorepo/pvt/
39+
40+
test-forge:
41+
runs-on: ubuntu-latest
42+
needs: lint-and-build
43+
steps:
44+
- uses: actions/checkout@v4
45+
- uses: actions/download-artifact@v4
46+
with:
47+
name: built-artifacts
48+
path: artifacts/
49+
- uses: actions/download-artifact@v4
50+
with:
51+
name: built-lib
52+
path: lib/balancer-v3-monorepo/pkg/
53+
- uses: actions/download-artifact@v4
54+
with:
55+
name: built-lib-pvt
56+
path: lib/balancer-v3-monorepo/pvt/
57+
- name: Set up environment
58+
uses: ./.github/actions/setup
59+
- name: Test
60+
run: yarn test:forge
61+
62+
test-hardhat:
63+
runs-on: ubuntu-latest
64+
needs: lint-and-build
65+
steps:
66+
- uses: actions/checkout@v4
67+
- name: Set up environment
68+
uses: ./.github/actions/setup
69+
- uses: actions/download-artifact@v4
70+
with:
71+
name: built-artifacts
72+
path: artifacts/
73+
- uses: actions/download-artifact@v4
74+
with:
75+
name: built-lib
76+
path: lib/balancer-v3-monorepo/pkg/
77+
- uses: actions/download-artifact@v4
78+
with:
79+
name: built-lib-pvt
80+
path: lib/balancer-v3-monorepo/pvt/
81+
- name: Test
82+
run: yarn test:hardhat

.yarn/plugins/@yarnpkg/plugin-typescript.cjs

Lines changed: 9 additions & 0 deletions
Large diffs are not rendered by default.

.yarn/plugins/@yarnpkg/plugin-version.cjs

Lines changed: 550 additions & 0 deletions
Large diffs are not rendered by default.

.yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs

Lines changed: 28 additions & 0 deletions
Large diffs are not rendered by default.

.yarn/releases/yarn-4.0.0-rc.42.cjs

Lines changed: 876 additions & 0 deletions
Large diffs are not rendered by default.

.yarn/versions/1dfc32f3.yml

Whitespace-only changes.

.yarnrc.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
compressionLevel: mixed
1+
nodeLinker: node-modules
22

3-
enableGlobalCache: false
3+
npmPublishAccess: public
44

5-
nodeLinker: node-modules
5+
yarnPath: .yarn/releases/yarn-4.0.0-rc.42.cjs

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"compile:watch": "nodemon --ext sol --exec yarn compile",
2323
"lint": "yarn lint:solidity && yarn lint:typescript",
2424
"lint:solidity": "npx prettier --check --plugin=prettier-plugin-solidity 'contracts/**/*.sol' ''test/**/*.sol'' && npx solhint 'contracts/**/*.sol'",
25-
"lint:typescript": "NODE_NO_WARNINGS=1 eslint --ext .ts --ignore-path ../../.eslintignore --max-warnings 0",
25+
"lint:typescript": "NODE_NO_WARNINGS=1 eslint --ext .ts --ignore-path ./.eslintignore --max-warnings 0",
2626
"prettier": "npx prettier --write --plugin=prettier-plugin-solidity 'contracts/**/*.sol' 'test/**/*.sol'",
2727
"test": "yarn test:hardhat && yarn test:forge",
2828
"test:hardhat": "hardhat test",

0 commit comments

Comments
 (0)