Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 0 additions & 5 deletions .changeset/smooth-balloons-stare.md

This file was deleted.

3 changes: 1 addition & 2 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,8 @@ RUN curl -L https://foundry.paradigm.xyz | bash && \
chmod 755 /usr/local/bin/forge && \
chmod 755 /usr/local/bin/chisel

# Set up yarn and pnpm
# Set up pnpm
RUN corepack enable && \
corepack prepare [email protected] --activate && \
corepack prepare [email protected] --activate

# Ensure all users have access to the tools
Expand Down
8 changes: 4 additions & 4 deletions .devcontainer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ The container uses a conservative caching approach to prevent cache corruption i
- Python packages: `/home/vscode/.cache/pip`

3. **Intentionally Not Cached**: These tools use their default cache locations to avoid contamination
- NPM, Yarn (different dependency versions per branch)
- NPM (different dependency versions per branch)
- Foundry, Solidity (different compilation artifacts per branch)
- Hardhat (different build artifacts per branch)

Expand All @@ -49,7 +49,7 @@ To start the dev container:

When the container starts, the `project-setup.sh` script will automatically run and:

- Install project dependencies using yarn
- Install project dependencies using pnpm
- Configure Git to use SSH signing with your forwarded SSH key
- Source shell customizations if available in PATH

Expand Down Expand Up @@ -79,8 +79,8 @@ These environment variables are needed for Git commit signing to work properly.
If you encounter build or compilation issues that seem related to cached artifacts:

1. **Rebuild the container**: This will start with fresh local caches
2. **Clean project caches**: Run `yarn clean` to clear project-specific build artifacts
3. **Clear node modules**: Delete `node_modules` and run `yarn install` again
2. **Clean project caches**: Run `pnpm clean` to clear project-specific build artifacts
3. **Clear node modules**: Delete `node_modules` and run `pnpm install` again

### Git SSH Signing Issues

Expand Down
6 changes: 5 additions & 1 deletion .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ services:
- GH_CONFIG_DIR=/home/vscode/.cache/github
- PIP_CACHE_DIR=/home/vscode/.cache/pip

# Note: NPM, Yarn, Foundry, and Solidity caches are intentionally not set
# pnpm cache is safe to share due to content-addressable storage
- PNPM_HOME=/home/vscode/.local/share/pnpm
- PNPM_CACHE_DIR=/home/vscode/.cache/pnpm

# Note: NPM, Foundry, and Solidity caches are intentionally not set
# to avoid cross-branch contamination. Tools will use their default locations.
volumes:
# Git repo root
Expand Down
6 changes: 3 additions & 3 deletions .devcontainer/project-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ echo "User directories set up with proper permissions"
# Install project dependencies
echo "Installing project dependencies..."
if [ -f "$REPO_ROOT/package.json" ]; then
echo "Running yarn to install dependencies..."
echo "Running pnpm to install dependencies..."
cd "$REPO_ROOT"
# Note: With set -e, if yarn fails, the script will exit
# Note: With set -e, if pnpm fails, the script will exit
# This is desirable as we want to ensure dependencies are properly installed
yarn
pnpm install
else
echo "No package.json found in the root directory, skipping dependency installation"
fi
Expand Down
11 changes: 8 additions & 3 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,19 @@ runs:
run: |
sudo apt-get update
sudo apt-get install -y libudev-dev libusb-1.0-0-dev
- name: Enable corepack for modern yarn
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
- name: Enable Corepack
shell: bash
run: corepack enable
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'yarn'
cache: 'pnpm'
- name: Set up pnpm via Corepack
shell: bash
run: corepack prepare [email protected] --activate
- name: Install dependencies
shell: bash
run: yarn --immutable
run: pnpm install --frozen-lockfile
50 changes: 50 additions & 0 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Build and Test

env:
CI: true
STUDIO_API_KEY: ${{ secrets.STUDIO_API_KEY }}

on:
pull_request:
branches: '*'
workflow_dispatch:

jobs:
test:
name: Build and Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive

- name: Set up environment
uses: ./.github/actions/setup

- name: Build all packages
run: pnpm -r --sequential run build

- name: Test all packages
run: pnpm -r --sequential run test

- name: Test with coverage
run: pnpm -r --sequential run test:coverage

- name: Find coverage files
id: coverage_files
run: |
# Find all coverage-final.json files
COVERAGE_FILES=$(find ./packages -name "coverage-final.json" -path "*/reports/coverage/*" | tr '\n' ',' | sed 's/,$//')
echo "files=$COVERAGE_FILES" >> $GITHUB_OUTPUT
echo "Found coverage files: $COVERAGE_FILES"

- name: Upload coverage reports
if: steps.coverage_files.outputs.files != ''
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ${{ steps.coverage_files.outputs.files }}
flags: unittests
name: graphprotocol-contracts
fail_ci_if_error: true
23 changes: 0 additions & 23 deletions .github/workflows/build.yml

This file was deleted.

43 changes: 0 additions & 43 deletions .github/workflows/ci-contracts.yml

This file was deleted.

32 changes: 0 additions & 32 deletions .github/workflows/ci-data-edge.yml

This file was deleted.

37 changes: 0 additions & 37 deletions .github/workflows/ci-token-dist.yml

This file was deleted.

21 changes: 19 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ env:
CI: true

on:
push:
branches: '*'
pull_request:
branches: '*'
workflow_dispatch:
Expand Down Expand Up @@ -169,6 +167,15 @@ jobs:
echo "sol_prettier_exit_code=0" >> $GITHUB_OUTPUT
fi

- name: Lint Solidity files (Natspec Documentation)
id: lint_sol_natspec
continue-on-error: true
run: |
echo "Checking Solidity documentation with natspec-smells..."
# Run natspec-smells from root to check all configured packages
npx natspec-smells
echo "sol_natspec_exit_code=$?" >> $GITHUB_OUTPUT

- name: Lint Markdown files (Markdownlint)
id: lint_md_markdownlint
continue-on-error: true
Expand Down Expand Up @@ -262,6 +269,7 @@ jobs:
TS_PRETTIER_EXIT_CODE="${{ steps.lint_ts_prettier.outputs.ts_prettier_exit_code }}"
SOL_SOLHINT_EXIT_CODE="${{ steps.lint_sol_solhint.outputs.sol_solhint_exit_code }}"
SOL_PRETTIER_EXIT_CODE="${{ steps.lint_sol_prettier.outputs.sol_prettier_exit_code }}"
SOL_NATSPEC_EXIT_CODE="${{ steps.lint_sol_natspec.outputs.sol_natspec_exit_code }}"
MD_MARKDOWNLINT_EXIT_CODE="${{ steps.lint_md_markdownlint.outputs.md_markdownlint_exit_code }}"
MD_PRETTIER_EXIT_CODE="${{ steps.lint_md_prettier.outputs.md_prettier_exit_code }}"
JSON_PRETTIER_EXIT_CODE="${{ steps.lint_json_prettier.outputs.json_prettier_exit_code }}"
Expand Down Expand Up @@ -312,6 +320,15 @@ jobs:
WARNINGS=$((WARNINGS+1))
fi

# Solidity - Natspec Documentation
if [ "$SOL_NATSPEC_EXIT_CODE" = "1" ]; then
echo "::error::natspec-smells found documentation issues in Solidity files"
ERRORS=$((ERRORS+1))
elif [ "$SOL_NATSPEC_EXIT_CODE" != "0" ]; then
echo "::warning::natspec-smells found warnings in Solidity files"
WARNINGS=$((WARNINGS+1))
fi

# Markdown - Markdownlint
if [ "$MD_MARKDOWNLINT_EXIT_CODE" = "1" ]; then
echo "::error::Markdownlint found errors in Markdown files"
Expand Down
12 changes: 7 additions & 5 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ on:
required: true
type: choice
options:
- contracts
- sdk
- contracts
- sdk
tag:
description: 'Tag to publish'
required: true
Expand All @@ -23,12 +23,14 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up environment
uses: ./.github/actions/setup
- name: Set npm token for publishing
run: pnpm config set //registry.npmjs.org/:_authToken ${{ secrets.GRAPHPROTOCOL_NPM_TOKEN }}
- name: Publish 🚀
shell: bash
run: |
pushd packages/${{ inputs.package }}
yarn npm publish --tag ${{ inputs.tag }} --access public
env:
YARN_NPM_AUTH_TOKEN: ${{ secrets.GRAPHPROTOCOL_NPM_TOKEN }}
pnpm publish --tag ${{ inputs.tag }} --access public --no-git-checks
Loading
Loading