Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
a4d69ed
chore: update GitHub workflows for coverage, deployment, and testing
Le-Caignec Apr 17, 2025
6941f08
refactor: add formatting scripts and .prettierignore for code consist…
Le-Caignec Apr 17, 2025
0d9261f
Merge remote-tracking branch 'origin/feature/setup-agnostique-test-st…
Le-Caignec Apr 17, 2025
b92e196
chore: update dependencies in package.json
Le-Caignec Apr 17, 2025
255fe5e
chore: remove conventional commits workflow
Le-Caignec Apr 22, 2025
2611d54
chore: remove Jenkinsfiles and update deployment scripts in package.json
Le-Caignec Apr 22, 2025
94bd6c4
refactor: update deployment environment variable and rename end-to-en…
Le-Caignec Apr 22, 2025
1499619
refactor: update test scripts to run unit and integration tests separ…
Le-Caignec Apr 22, 2025
f0c13d4
Merge branch 'feature/setup-agnostique-test-stack-based-on-fork' into…
Le-Caignec Apr 22, 2025
8c55708
refactor: reorganize CI workflow steps for improved clarity and effic…
Le-Caignec Apr 22, 2025
8a04ba4
refactor: update test environment preparation script to use tsx
Le-Caignec Apr 22, 2025
de5cd5d
refactor: use npx to run prepare-test-env script in CI workflow
Le-Caignec Apr 22, 2025
b19c5d3
refactor: streamline local stack environment preparation in CI workflow
Le-Caignec Apr 22, 2025
3358762
refactor: remove unused steps from CI workflow for cleaner execution
Le-Caignec Apr 22, 2025
d0a46b5
refactor: clean up package.json and add Jenkins integration test pipe…
Le-Caignec Apr 22, 2025
f591d8b
refactor: update test command to run unit tests explicitly
Le-Caignec Apr 22, 2025
f92fb4e
rollback: file
Le-Caignec Apr 22, 2025
4e7194b
Merge remote-tracking branch 'origin/feature/setup-agnostique-test-st…
Le-Caignec Apr 22, 2025
2511e1c
feat: add formatting scripts to package.json for code consistency
Le-Caignec Apr 22, 2025
678fd58
Update .gitignore
Le-Caignec Apr 23, 2025
d31eb65
fix merge
Le-Caignec Apr 23, 2025
be5ace4
refactor: add names to steps in deploy-subgraph workflow for clarity
Le-Caignec Apr 23, 2025
b306f70
chore: add newlines for improved readability in coverage workflow
Le-Caignec Apr 23, 2025
02abd3f
Update package.json
Le-Caignec Apr 23, 2025
4d5e4e1
chore: add .nvmrc file for Node version management and update import …
Le-Caignec Apr 23, 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
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/docker-build.yml@docker-build-v2.0.0
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/docker-build.yml@docker-build-v2.0.0
with:
image-name: 'iexechub/voucher-subgraph-deployer'
image-tag: ${{ github.sha }}
push: false
security-scan: true
31 changes: 25 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,42 @@
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-subgraph:
runs-on: ubuntu-latest

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

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

- name: Init
run: npm ci
- name: Test build

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

- name: Build
run: npm run build

- name: Run unit tests
run: npm run test
# See Jenkinsfile-itest for "Run integration tests" step
run: npm run test:unit

4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ node_modules
build
generated
yarn.lock
tests/.bin/*
tests/.latest.json
subgraph.test.yaml
test-stack/.env
test/.bin
test/.latest.json
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
20.18
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/**
67 changes: 0 additions & 67 deletions Jenkinsfile

This file was deleted.

2 changes: 1 addition & 1 deletion itest/integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { ApolloClient, gql } from '@apollo/client/core';
import { equal } from 'assert';
import { JsonRpcProvider, Wallet, ZeroHash } from 'ethers';
import { AppRegistry__factory, IexecInterfaceToken__factory } from '../generated/typechain';
import config from '../networks.json' assert { type: 'json' };
import config from '../networks.json' with { type: 'json' };

const APIURL = `http://localhost:8000/subgraphs/name/${process.env.NETWORK_NAME}/poco`;
const client = new ApolloClient({
Expand Down
Loading