Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
932aabe
Merge pull request #33 from iExecBlockchainComputing/feature/back-mer…
Le-Caignec Feb 20, 2025
9387f22
test new deploySubGraph workflow inputs
gfournieriExec Mar 26, 2025
b6ba760
Fix syntax in Jenkinsfile_Subgraph for deploySubGraph parameters
gfournieriExec Mar 26, 2025
20f6f43
add subgraph.yaml
gfournieriExec Mar 26, 2025
e118d42
update gitignore
gfournieriExec Mar 26, 2025
a0941e5
typo
gfournieriExec Mar 26, 2025
67156cc
use user inputs
gfournieriExec Mar 26, 2025
66a9053
point tmp to prod
gfournieriExec Mar 26, 2025
81999a3
just consle log
gfournieriExec Mar 26, 2025
e353d7f
get back the library
gfournieriExec Mar 26, 2025
b73e3b5
remove logs
gfournieriExec Mar 26, 2025
948c495
update name
gfournieriExec Mar 26, 2025
a6fd375
add ,
gfournieriExec Mar 26, 2025
af78b7a
Remove
gfournieriExec Mar 27, 2025
cf058a7
remove line
gfournieriExec Mar 27, 2025
2e5f7c6
add 1 removed file for diff
gfournieriExec Mar 27, 2025
20a3949
update changelog
gfournieriExec Mar 27, 2025
e7626cc
update readme
gfournieriExec Mar 27, 2025
e65a4bc
remove all duplicates
gfournieriExec Mar 27, 2025
c3a946d
remove subgraph.template.yaml mention to subgraph.yaml
gfournieriExec Mar 27, 2025
58d0523
update changelog
gfournieriExec Mar 27, 2025
06c9ae5
remove useless networks
gfournieriExec Mar 27, 2025
b0762c7
only use bellecour in choice
gfournieriExec Mar 27, 2025
53ce877
Merge branch 'feature/clean-and-correct' into feature/clean-and-corre…
gfournieriExec Mar 27, 2025
08ce6a7
Merge pull request #36 from iExecBlockchainComputing/feature/clean-an…
gfournieriExec Mar 27, 2025
d9fde6a
Merge branch 'develop' into feature/clean-and-correct-part2
gfournieriExec Mar 27, 2025
721f751
Merge pull request #37 from iExecBlockchainComputing/feature/clean-an…
gfournieriExec Mar 28, 2025
7d9e178
feat: Setup agnostic test stack (#38)
Le-Caignec Apr 29, 2025
b9b288e
chore(deps): update minor updates 📉
iexec-renovate-app[bot] Jun 14, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
node_modules

# generated files
build
generated

# test files
test-stack
11 changes: 11 additions & 0 deletions .env.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# The name of the network (e.g., mainnet, arbitrum, etc.)
NETWORK_NAME=...

# The URL of the Graph Node endpoint for self-hosted Graph Node
GRAPHNODE_URL=...

# The URL of the IPFS endpoint for self-hosted IPFS
IPFS_URL=...

# The version label for the deployment (e.g., v1.0.0)
VERSION_LABEL=...
4 changes: 4 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,16 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Init
run: npm ci

- name: Run Coverage
run: (npm run coverage 2>&1) | tee /tmp/coverage.out | cat

- name: Extract coverage
run: echo "COVERAGE=$(cat /tmp/coverage.out | grep "Global test coverage")" >> $GITHUB_ENV

- name: Display coverage in Github PR checks
# See https://docs.github.com/en/rest/checks/runs?apiVersion=2022-11-28#create-a-check-run
# and https://www.kenmuse.com/blog/creating-github-checks/
Expand Down
61 changes: 61 additions & 0 deletions .github/workflows/deploy-subgraph.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Deploy Subgraph

on:
workflow_dispatch: # Triggered manually but we can also trigger with an release event
inputs:
environment:
description: 'Deployment environment (must match a GitHub Environment name)'
required: true
default: staging
type: choice
options:
- staging
- production
- tmp
# Add new networks when needed. Do not forget to add necessary data in the networks.json file.
networkName:
description: 'Network Name'
required: false
default: bellecour
type: choice
options:
- bellecour
versionLabel:
description: 'Version Label for Subgraph Deployment'
required: false
default: develop
type: string

jobs:
deploy:
runs-on: ubuntu-latest
# Associate the job with a GitHub Environment which has pre-defined variables and secrets.
environment: ${{ github.event.inputs.environment }}
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Install dependencies
run: npm ci

- name: Deploy Subgraph
env:
NETWORK_NAME: ${{ github.event.inputs.networkName }}
VERSION_LABEL: ${{ github.event.inputs.versionLabel }}
GRAPHNODE_URL: ${{ vars.GRAPHNODE_URL }}
IPFS_URL: ${{ vars.IPFS_URL }}
DEPLOY_ENV: ${{ vars.ENV_NAME }}
run: |
echo "Starting deployment with the following parameters:"
echo " Network Name: $NETWORK_NAME"
echo " Version Label: $VERSION_LABEL"
echo " DEPLOY_ENV: $DEPLOY_ENV"
echo " GRAPHNODE_URL: $GRAPHNODE_URL"
echo " IPFS_URL: $IPFS_URL"
npm run all
shell: bash
40 changes: 40 additions & 0 deletions .github/workflows/docker-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Build and Push Subgraph Deployer Docker Image

on:
push:
tags:
- '*' # Trigger on tag push
workflow_dispatch:

jobs:
# Need to compute the tag based on the event type
compute-tag:
runs-on: ubuntu-latest
outputs:
computed_tag: ${{ steps.set_tag.outputs.computed_tag }}
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set image tag
id: set_tag
run: |
set -e
if [ "${GITHUB_EVENT_NAME}" = "workflow_dispatch" ]; then
latest_tag=$(git describe --tags --abbrev=0)
echo "computed_tag=${latest_tag}+dev+${GITHUB_SHA}" >> $GITHUB_OUTPUT
else
echo "computed_tag=${GITHUB_REF_NAME}" >> $GITHUB_OUTPUT

build:
needs: compute-tag
uses: iExecBlockchainComputing/github-actions-workflows/.github/workflows/[email protected]
with:
image-name: 'iexechub/voucher-subgraph-deployer'
image-tag: ${{ needs.compute-tag.outputs.computed_tag }}
security-scan: false
hadolint: false
push: true
secrets:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PAT }}
12 changes: 12 additions & 0 deletions .github/workflows/docker-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Test Docker Image

on: [pull_request]

jobs:
build-test:
uses: iExecBlockchainComputing/github-actions-workflows/.github/workflows/[email protected]
with:
image-name: 'iexechub/voucher-subgraph-deployer'
image-tag: ${{ github.sha }}
push: false
security-scan: true
40 changes: 32 additions & 8 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,47 @@
name: default

on:
push:
branches:
- feature/*
- bugfix/*
- develop
- release/*
- hotfix/*
- develop
- main

concurrency:
group: ci-${{ github.head_ref }}
cancel-in-progress: true

jobs:
test:
runs-on: ubuntu-22.04 # For 24.04+, see https://github.com/graphprotocol/graph-tooling/issues/1546#issuecomment-2589680195
build-and-test:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
- name: Init

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'

- name: Install dependencies
run: npm ci
- name: Run unit tests
run: npm run test
- name: Test build

- name: Check Format
run: npm run check-format

- name: Build
run: npm run build
# See Jenkinsfile-itest for "Run integration tests" step

- name: Run unit tests
run: npm run test:unit

- name: Prepare test stack
run: npm run start-test-stack

- name: Run integration tests
run: npm run test:e2e
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ node_modules
build
generated
yarn.lock
test/.bin
subgraph.yaml
subgraph.test.yaml
test-stack/.env
tests/.bin
tests/.latest.json
.env
7 changes: 5 additions & 2 deletions .mocharc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{
"extension": ["ts"],
"spec": "itest/**/*.ts",
"require": ["ts-node/register"],
"timeout": 1000000
"timeout": 1000000,
"node-option": [
"experimental-specifier-resolution=node",
"loader=ts-node/esm"
]
}
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
20.19
6 changes: 6 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
*.graphql
*.md
*.yml

##TODO: To remove and format this folder in an other PR
src/**
14 changes: 12 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
# Changelog

## vNEXT

- Add Arbitrum & Avalanche networks. (#47)
- Migrate integration tests from Jenkins to GitHub Actions. (#44)
- Remove unused files to streamline the repository. (#42)
- Rewrite Jenkins CI for future migration (#36, #37)
- Add a modern test stack, agnostic to the forked network. (#38)
- Add a section in the README to explain how to use the Docker-based subgraph deployer. (#38)

## v1.1.0 - Support deal sponsor

- Add `sponsor` to `deal`. (#31)
- Update deployment hosts:
- production (#30)
- staging (#29)
- production (#30)
- staging (#29)
- Display coverage in Github PR checks. (#26)
- Add integration test suite. (#21)
- Add unit test suite. (#20)
Expand Down
15 changes: 15 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# iexec-poco-subgraph deployer

FROM node:20

WORKDIR /iexec-poco-subgraph

COPY package*.json .
COPY schema.graphql .
COPY subgraph.yaml .
COPY networks.json .
COPY src ./src

RUN npm ci

ENTRYPOINT [ "npm", "run", "all" ]
63 changes: 0 additions & 63 deletions Jenkinsfile

This file was deleted.

31 changes: 0 additions & 31 deletions Jenkinsfile-itest

This file was deleted.

11 changes: 0 additions & 11 deletions Jenkinsfile_Subgraph_bellecour

This file was deleted.

Loading