-
Notifications
You must be signed in to change notification settings - Fork 4
feature/refactor-ci #43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Le-Caignec
merged 25 commits into
feature/setup-agnostique-test-stack-based-on-fork
from
feature/refactor-ci
Apr 23, 2025
Merged
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 6941f08
refactor: add formatting scripts and .prettierignore for code consist…
Le-Caignec 0d9261f
Merge remote-tracking branch 'origin/feature/setup-agnostique-test-st…
Le-Caignec b92e196
chore: update dependencies in package.json
Le-Caignec 255fe5e
chore: remove conventional commits workflow
Le-Caignec 2611d54
chore: remove Jenkinsfiles and update deployment scripts in package.json
Le-Caignec 94bd6c4
refactor: update deployment environment variable and rename end-to-en…
Le-Caignec 1499619
refactor: update test scripts to run unit and integration tests separ…
Le-Caignec f0c13d4
Merge branch 'feature/setup-agnostique-test-stack-based-on-fork' into…
Le-Caignec 8c55708
refactor: reorganize CI workflow steps for improved clarity and effic…
Le-Caignec 8a04ba4
refactor: update test environment preparation script to use tsx
Le-Caignec de5cd5d
refactor: use npx to run prepare-test-env script in CI workflow
Le-Caignec b19c5d3
refactor: streamline local stack environment preparation in CI workflow
Le-Caignec 3358762
refactor: remove unused steps from CI workflow for cleaner execution
Le-Caignec d0a46b5
refactor: clean up package.json and add Jenkins integration test pipe…
Le-Caignec f591d8b
refactor: update test command to run unit tests explicitly
Le-Caignec f92fb4e
rollback: file
Le-Caignec 4e7194b
Merge remote-tracking branch 'origin/feature/setup-agnostique-test-st…
Le-Caignec 2511e1c
feat: add formatting scripts to package.json for code consistency
Le-Caignec 678fd58
Update .gitignore
Le-Caignec d31eb65
fix merge
Le-Caignec be5ace4
refactor: add names to steps in deploy-subgraph workflow for clarity
Le-Caignec b306f70
chore: add newlines for improved readability in coverage workflow
Le-Caignec 02abd3f
Update package.json
Le-Caignec 4d5e4e1
chore: add .nvmrc file for Node version management and update import …
Le-Caignec File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
zguesmi marked this conversation as resolved.
Show resolved
Hide resolved
|
||
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' | ||
|
||
Le-Caignec marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
zguesmi marked this conversation as resolved.
Show resolved
Hide resolved
|
||
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 | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
20.18 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/** |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.