Skip to content

ci: migrate CI to GitHub Actions #352

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
merged 52 commits into from
Jul 3, 2025
Merged
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
85c36ae
ci: add GitHub Actions workflow
TartanLeGrand Mar 25, 2025
0404363
refactor: streamline CI configuration and improve service definitions
TartanLeGrand Apr 21, 2025
88f56c5
refactor: streamline CI configuration and improve service definitions
TartanLeGrand Apr 21, 2025
4810e38
refactor: adjust command options for service containers in CI configu…
TartanLeGrand Apr 24, 2025
3a6eba5
refactor: simplify CI
TartanLeGrand Apr 25, 2025
1b53f68
refactor: simplify local stack setup in CI configuration
TartanLeGrand Apr 25, 2025
23d8223
fix: add test secrets
PierreJeanjacquot Jun 19, 2025
e234dc1
chore: clean drone specific tests behaviors
PierreJeanjacquot Jun 23, 2025
76285ab
chore: move SONAR_HOST_URL to secrets
PierreJeanjacquot Jun 23, 2025
1fa8586
feat: check conventional commit in PR title
PierreJeanjacquot Jun 23, 2025
0e3197e
refactor: simplify test pipeline
PierreJeanjacquot Jun 23, 2025
c4d9640
ci: cache deps
PierreJeanjacquot Jul 1, 2025
8d1d71f
ci: split pipeline jobs
PierreJeanjacquot Jul 1, 2025
6ad75ca
ci: add concurrency check
PierreJeanjacquot Jul 1, 2025
6fc82e6
ci: add build test
PierreJeanjacquot Jul 1, 2025
cb7714c
ci: stop test stack after testing
PierreJeanjacquot Jul 1, 2025
a90d824
refactor: cleanup useless xxd install as it is already included in ub…
PierreJeanjacquot Jul 1, 2025
3f8dbe4
ci: setup reusable test
PierreJeanjacquot Jul 1, 2025
78bee44
fix: pass artifact-ids from test-node-18
PierreJeanjacquot Jul 1, 2025
03d3973
fix: update concurrency group
PierreJeanjacquot Jul 1, 2025
43fc61b
ci: add docker publish dry-run
PierreJeanjacquot Jul 1, 2025
096e56a
fix: docker workflow needs a tag
PierreJeanjacquot Jul 1, 2025
573a6c8
fix: disable docker-build failing options
PierreJeanjacquot Jul 1, 2025
848ceda
chore: format
PierreJeanjacquot Jul 1, 2025
433b79b
refactor: use publish-npm reusable workflow
PierreJeanjacquot Jul 2, 2025
61e2e7c
fix: iexec bin path
PierreJeanjacquot Jul 2, 2025
0878e55
fix: use fixed docker-build workflow
PierreJeanjacquot Jul 2, 2025
d3801ef
ci: enable hadolint
PierreJeanjacquot Jul 2, 2025
cf979a0
chore: git ignore generated files
PierreJeanjacquot Jul 2, 2025
ab3a0cd
ci: enable security-scan
PierreJeanjacquot Jul 2, 2025
729cc93
chore: move to publish-npm-v1.5.0
PierreJeanjacquot Jul 2, 2025
371eb79
ci: security scan report in comment
PierreJeanjacquot Jul 2, 2025
2702d65
ci: test security-report sarif
PierreJeanjacquot Jul 2, 2025
5c533ab
ci: test security-report mode comment
PierreJeanjacquot Jul 2, 2025
b310f48
ci: set deployment env to blank (not deployed in dry-run)
PierreJeanjacquot Jul 2, 2025
77eeaa1
refactor: add reusable npm
PierreJeanjacquot Jul 2, 2025
f4feef5
refactor: rename test step
PierreJeanjacquot Jul 2, 2025
b44cd69
refactor: reusable docker
PierreJeanjacquot Jul 2, 2025
1159dda
refactor: yml extensions consistency
PierreJeanjacquot Jul 2, 2025
e6da04b
ci: add dispatchable workflow npm-staging
PierreJeanjacquot Jul 2, 2025
81914b7
ci: add dispatchable workflow docker-staging
PierreJeanjacquot Jul 2, 2025
179d35a
chore: clean migrated pipeline
PierreJeanjacquot Jul 2, 2025
e87a7c9
fix: coverage artifact not found sonar
PierreJeanjacquot Jul 2, 2025
9dd2343
docs: add workflow descriptions
PierreJeanjacquot Jul 2, 2025
8ab5236
fix: forward npm version
PierreJeanjacquot Jul 2, 2025
b0f1743
fix: coverage artifact name
PierreJeanjacquot Jul 2, 2025
d2c8a12
fix: run codegen for sonar
PierreJeanjacquot Jul 2, 2025
b051a1a
chore: use tagged version of docker-build
PierreJeanjacquot Jul 2, 2025
c3d8578
refactor: get commit sha from github context
PierreJeanjacquot Jul 3, 2025
b1967a2
refactor: use tee instead of duplicating echo
PierreJeanjacquot Jul 3, 2025
31871fb
feat: run cross version tests on release PR
PierreJeanjacquot Jul 3, 2025
b7cbc8a
fix: remove bad description
PierreJeanjacquot Jul 3, 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
469 changes: 0 additions & 469 deletions .drone.yml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
name: Conventional Commits Check
name: Conventional Commit Check Commits
description: checks every commit in the PR respects the conventional commit

on: [pull_request]

jobs:
check-conventional-commits:
name: Conventional Commits
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Check Commit Conventions
uses: webiny/action-conventional-commits@v1.3.0
15 changes: 15 additions & 0 deletions .github/workflows/conventional-commit-check-pr-title.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Conventional Commit Check PR Title
description: checks the PR title respects the conventional commit

on:
pull_request_target:
types:
- opened
- edited
- reopened

jobs:
lint-pr-title:
permissions:
pull-requests: read
uses: iExecBlockchainComputing/github-actions-workflows/.github/workflows/conventional-commits.yml@conventional-commits-v1.1.0
19 changes: 19 additions & 0 deletions .github/workflows/docker-staging.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: docker publish staging
description: Publish a staging version on docker registry

on:
workflow_dispatch:

jobs:
compute-staging-version:
uses: ./.github/workflows/reusable-compute-staging-version.yml

docker-publish:
uses: ./.github/workflows/reusable-docker.yml
needs: compute-staging-version
with:
dry-run: true # TODO set to false
tag: ${{ needs.compute-staging-version.outputs.version }}
secrets:
docker-username: ${{ secrets.DOCKERHUB_USERNAME }} # TODO ensure secret is set
docker-password: ${{ secrets.DOCKERHUB_TOKEN }} # TODO ensure secret is set
19 changes: 19 additions & 0 deletions .github/workflows/npm-staging.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: npm publish staging
description: Publish a staging version on npm

on:
workflow_dispatch:

jobs:
compute-staging-version:
uses: ./.github/workflows/reusable-compute-staging-version.yml

npm-publish:
uses: ./.github/workflows/reusable-npm.yml
needs: compute-staging-version
with:
dry-run: true # TODO set to false
version: ${{ needs.compute-staging-version.outputs.version }}
tag: ${{ needs.compute-staging-version.outputs.dist-tag }}
secrets:
npm-token: ${{ secrets.NPM_TOKEN }}
88 changes: 88 additions & 0 deletions .github/workflows/pr-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: PR test
description: tests the PR

on: [pull_request]

concurrency:
group: ${{ github.ref }}-pr-test
cancel-in-progress: true

jobs:
check-code:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

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

- name: Install dependencies
run: npm ci && npm run codegen

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

- name: Lint
run: npm run lint

test:
uses: ./.github/workflows/reusable-test.yml
with:
node-version: '18'
upload-coverage: true
secrets:
infura-project-id: ${{ secrets.INFURA_PROJECT_ID }}
etherscan-api-key: ${{ secrets.ETHERSCAN_API_KEY }}
alchemy-api-key: ${{ secrets.ALCHEMY_API_KEY }}

test-node-versions:
uses: ./.github/workflows/reusable-test.yml
# for release PR run tests on all supported node versions
if: ${{ contains('release-please--', github.ref_name ) }}
strategy:
matrix:
node-version: ['20', '22', '24']
with:
node-version:
secrets:
infura-project-id: ${{ secrets.INFURA_PROJECT_ID }}
etherscan-api-key: ${{ secrets.ETHERSCAN_API_KEY }}
alchemy-api-key: ${{ secrets.ALCHEMY_API_KEY }}

sonar:
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v4

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

- name: Install dependencies
run: npm ci && npm run codegen

- uses: actions/download-artifact@v4
with:
artifact-ids: ${{ needs.test.outputs.coverage-artifact-id }}

- name: SonarScanner
uses: SonarSource/sonarqube-scan-action@v5.1.0
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}

npm-dry-run:
uses: ./.github/workflows/reusable-npm.yml
with:
dry-run: true

docker-dry-run:
uses: ./.github/workflows/reusable-docker.yml
with:
dry-run: true
5 changes: 3 additions & 2 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
name: release-please
description: triggers release-please to open the next release PR

on:
push:
branches:
@@ -8,8 +11,6 @@ permissions:
issues: write
pull-requests: write

name: release-please

jobs:
release-please:
uses: iExecBlockchainComputing/github-actions-workflows/.github/workflows/release-please.yml@release-please-v2.1.0
33 changes: 33 additions & 0 deletions .github/workflows/reusable-compute-staging-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Compute staging version
description: compute a staging version from the current version, branch name and commit

on:
workflow_call:
outputs:
version:
value: ${{ jobs.compute-staging-version.outputs.version }}
dist-tag:
value: ${{ jobs.compute-staging-version.outputs.dist-tag }}

jobs:
compute-staging-version:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Set publish version
id: set-publish-version
run: |
BRANCH=$(echo "${{ github.ref_name }}" | sed 's|/|-|g')
COMMIT_SHA="${{ github.sha }}"
CURRENT_VERSION=$(npm pkg get version | tr -d '"')
STAGING_VERSION="${CURRENT_VERSION}-${BRANCH}-${COMMIT_SHA::7}"
echo "VERSION=${STAGING_VERSION}" | tee -a $GITHUB_OUTPUT
echo "DIST_TAG=${BRANCH}" | tee -a $GITHUB_OUTPUT
outputs:
version: ${{ steps.set-publish-version.outputs.VERSION }}
dist-tag: ${{ steps.set-publish-version.outputs.DIST_TAG }}
38 changes: 38 additions & 0 deletions .github/workflows/reusable-docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: docker publish
description: reusable docker workflow for this project

on:
workflow_call:
inputs:
dry-run:
description: 'Run in dry-run mode (the docker image will not be published)'
default: false
type: boolean
tag:
description: 'Tag of Docker Image'
default: 'latest'
type: string
secrets:
docker-username:
description: 'Docker registry username (required unless `dry-run: true`)'
required: false
docker-password:
description: 'Docker registry password or PAT (required unless `dry-run: true`)'
required: false

jobs:
docker-publish:
uses: iExecBlockchainComputing/github-actions-workflows/.github/workflows/docker-build.yml@docker-build-v2.3.0
with:
image-name: 'iexechub/iexec-sdk'
registry: 'docker.io'
dockerfile: 'Dockerfile'
context: '.'
security-scan: true
security-report: 'sarif'
hadolint: true
push: ${{ !inputs.dry-run }}
image-tag: ${{ inputs.tag }}
secrets:
username: ${{ secrets.docker-username }}
password: ${{ secrets.docker-password }}
36 changes: 36 additions & 0 deletions .github/workflows/reusable-npm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: npm publish
description: reusable npm workflow for this project

on:
workflow_call:
inputs:
dry-run:
description: 'Run in dry-run mode (the package will not be published)'
default: false
type: boolean
version:
description: 'Version to publish (leave empty to use package.json version)'
default: ''
type: string
tag:
description: 'npm publish tag (e.g., latest, nightly)'
default: ''
type: string
secrets:
npm-token:
description: 'NPM auth token (required unless `dry-run: true`)'
required: false

jobs:
npm-publish:
uses: iExecBlockchainComputing/github-actions-workflows/.github/workflows/publish-npm.yml@publish-npm-v1.5.0
with:
install-command: npm ci
build-command: npm run build
dry-run: ${{ inputs.dry-run }}
tag: ${{ inputs.tag }}
version: ${{ inputs.version }}
environment: ${{ (inputs.dry-run && '') || inputs.tag }}
provenance: ${{ !inputs.dry-run }}
secrets:
npm-token: ${{ secrets.npm-token }}
71 changes: 71 additions & 0 deletions .github/workflows/reusable-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: test SDK
description: reusable test workflow for this project

on:
workflow_call:
inputs:
node-version:
description: 'Node version to use as specified in actions/setup-node@v4'
default: '20'
type: string
upload-coverage:
description: 'Upload coverage data for later reuse'
type: boolean
default: false
secrets:
infura-project-id:
required: true
etherscan-api-key:
required: true
alchemy-api-key:
required: true
outputs:
coverage-artifact-id:
description: 'Coverage artifact id (if `upload-coverage: true`)'
value: ${{ jobs.test.outputs.coverage-artifact-id }}

jobs:
test:
runs-on: ubuntu-latest
outputs:
coverage-artifact-id: ${{ steps.upload-coverage.outputs.artifact-id }}
steps:
- uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node-version }}
cache: 'npm'

- name: Install dependencies
run: npm ci && npm run

- name: Build
run: npm run build

- name: Install global
run: npm install -g .

- name: Start e2e test stack
run: npm run start-test-stack

- name: Test
run: npm test
env:
INFURA_PROJECT_ID: ${{ secrets.infura-project-id }}
ETHERSCAN_API_KEY: ${{ secrets.etherscan-api-key }}
ALCHEMY_API_KEY: ${{ secrets.alchemy-api-key }}

- name: Stop e2e test stack
if: always()
run: npm run stop-test-stack

- name: Upload coverage
id: upload-coverage
if: ${{ inputs.upload-coverage }}
uses: actions/upload-artifact@v4
with:
name: coverage
path: coverage
overwrite: true
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -29,6 +29,9 @@ test/tests-working-dir
# sonar output
.scannerwork

# codegen output
src/common/generated

# build output
dist/**
IExec*/**
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -45,6 +45,7 @@ Check the [documentation](./CLI.md)

```sh
npm ci
npm run codegen
```

### Build
Loading
Loading