diff --git a/.github/workflows/subgraph-ci.yml b/.github/workflows/subgraph-ci.yml new file mode 100644 index 0000000..a24abaf --- /dev/null +++ b/.github/workflows/subgraph-ci.yml @@ -0,0 +1,47 @@ +name: Subgraph CI + +on: + pull_request: + branches: [ master ] # PR vers le repo upstream + push: + branches: [ master ] # push sur ta branche master (fork) + workflow_dispatch: # lancement manuel si besoin + +jobs: + build: + name: Build on Node ${{ matrix.node }} + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + node: [18, 20] # 2 versions = crĂ©dible sans ĂȘtre lourd + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node }} + cache: yarn + + - name: Enable Corepack + run: corepack enable + + - name: Install dependencies + run: yarn install --frozen-lockfile || yarn install + + - name: Install Graph CLI (optional) + run: yarn global add @graphprotocol/graph-cli || true + + - name: Lint (if present) + run: yarn lint --if-present + + - name: Codegen (if present) + run: yarn codegen || echo "no codegen script - skipping" + + - name: Build (if present) + run: yarn build || echo "no build script - skipping" + + - name: Test (if present) + run: yarn test --if-present diff --git a/README.md b/README.md index 38e38d6..859957a 100644 --- a/README.md +++ b/README.md @@ -14,3 +14,23 @@ Talent Protocol uses the graph to aggregate and calculate some metrics to make i - Project homepage: https://talentprotocol.com - Twitter: https://twitter.com/talentprotocol - LinkedIn: https://linkedin.com/company/talentprotocol/ + +## Quickstart + +```bash +# Clone the repo +git clone https://github.com/talentprotocol/subgraph.git +cd subgraph + +# Install dependencies +corepack enable +yarn install + +# Generate types +yarn codegen + +# Build +yarn build + +# Optional: deploy to local or testnet +yarn deploy