Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into feature/gasp-1552
Browse files Browse the repository at this point in the history
  • Loading branch information
mateuszaaa committed Jan 23, 2025
2 parents 5643b7a + c1146db commit 12a1434
Show file tree
Hide file tree
Showing 209 changed files with 93,254 additions and 158 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/branch-frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ concurrency:
jobs:
init:
name: Set global version
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
outputs:
GLOBAL_VERSION: ${{ steps.set_vars.outputs.GLOBAL_VERSION }}
steps:
Expand Down
82 changes: 77 additions & 5 deletions .github/workflows/branch-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@ name: main branch workflow

on:
push:
branches: [main, feat/add-main-branch-ci-pipeline-MGX-834]
branches: [main]

permissions:
contents: write
id-token: write
deployments: write
checks: write
security-events: write

# The following concurrency group queus in-progress jobs
concurrency:
Expand All @@ -18,25 +19,96 @@ concurrency:
jobs:
init:
name: Set global version
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
outputs:
GLOBAL_VERSION: ${{ steps.set_vars.outputs.GLOBAL_VERSION }}
GIT_BRANCH: ${{ steps.set_vars.outputs.GIT_BRANCH }}
GIT_BRANCH_UNFORMATTED: ${{ steps.branch-name.outputs.current_branch }}
steps:
- name: Get branch name
id: branch-name
uses: tj-actions/branch-names@v8
- name: Set global version
id: set_vars
run: echo "GLOBAL_VERSION=${{ github.sha }}" >> $GITHUB_OUTPUT
run: |
echo "GLOBAL_VERSION=${{ github.sha }}" >> $GITHUB_OUTPUT
echo "GIT_BRANCH=${{ steps.branch-name.outputs.current_branch }}" | sed "s@/@-@g" >> $GITHUB_OUTPUT
echo "IMAGE_TAG=${{ github.sha }}" >> $GITHUB_STEP_SUMMARY
build-and-test:
needs: [init]
name: Build
name: Build AVS services
uses: ./.github/workflows/reusable-build-and-test.yml
secrets: inherit
with:
version: ${{ needs.init.outputs.GLOBAL_VERSION }}

build-and-test-gasp-node:
needs: [init]
name: Build gasp-node
uses: ./.github/workflows/reusable-gasp-node-build-and-test.yml
secrets: inherit
permissions:
contents: read
actions: read
checks: write
id-token: write
with:
version: ${{ needs.init.outputs.GLOBAL_VERSION }}
branch: ${{ needs.init.outputs.GIT_BRANCH }}

gasp-node-unit-tests-and-coverage:
name: '[gasp-node] Run unit tests and coverage'
needs: [init]
uses: ./.github/workflows/reusable-gasp-node-unit-tests-and-coverage.yml
secrets: inherit
permissions:
contents: read
actions: read
checks: write
id-token: write
with:
version: ${{ needs.init.outputs.GLOBAL_VERSION }}
branch: ${{ needs.init.outputs.GIT_BRANCH }}

gasp-node-generate-types:
name: '[gasp-node] Generate types'
needs: [init, build-and-test-gasp-node]
uses: ./.github/workflows/reusable-gasp-node-generate-types.yml
secrets: inherit
with:
# TODO: To be fixed when `eth-rollup-develop` branch in gasp-dev-kit is merged to `main`
# branch: ${{ needs.init.outputs.GIT_BRANCH_UNFORMATTED }}
branch: eth-rollup-develop
globalVersion: ${{ needs.init.outputs.GLOBAL_VERSION }}

run-e2e-test:
name: Run e2e tests
needs: [init, build-and-test]
uses: ./.github/workflows/reusable-e2e-tests.yml
secrets: inherit
permissions:
contents: read
actions: read
checks: write
with:
globalVersion: ${{ needs.init.outputs.GLOBAL_VERSION }}

run-e2e-test-gasp-node:
name: '[gasp-node] Run e2e tests'
needs: [init, build-and-test-gasp-node, gasp-node-generate-types]
uses: ./.github/workflows/reusable-gasp-node-e2e-tests.yml
secrets: inherit
permissions:
contents: read
actions: read
checks: write
with:
globalVersion: ${{ needs.init.outputs.GLOBAL_VERSION }}

deploy-dev:
name: Deploy `dev` environment
needs: [init, build-and-test]
needs: [init, build-and-test, build-and-test-gasp-node, gasp-node-unit-tests-and-coverage]
uses: ./.github/workflows/reusable-deploy.yml
secrets: inherit
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/deploy-rollup-holesky.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ permissions:
jobs:
init:
name: Set global version
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
outputs:
GLOBAL_VERSION: ${{ steps.set_vars.outputs.GLOBAL_VERSION }}
steps:
Expand All @@ -29,7 +29,7 @@ jobs:

deploy-rollup-holesky:
needs: [init, build-and-test]
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: jkroepke/[email protected]
Expand Down
18 changes: 8 additions & 10 deletions .github/workflows/stash.yml → .github/workflows/deploy-stash.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: stash service workflow
name: '[stash] Deploy `stash` to Google App Engine'
on:
workflow_dispatch:
inputs:
Expand All @@ -11,7 +11,6 @@ on:
- frontend
- holesky
- prod
pull_request:
push:
branches:
- main
Expand All @@ -26,7 +25,7 @@ permissions:
jobs:
build:
name: Build Project
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
defaults:
run:
working-directory: stash
Expand All @@ -53,9 +52,8 @@ jobs:
deploy-frontend:
name: Deploy `stash` to `frontend` environment
if: github.ref == 'refs/heads/main' || (github.event_name == 'workflow_dispatch' && github.event.inputs.environment == 'frontend')
runs-on: ubuntu-latest
needs: build
environment: stash-frontend
runs-on: ubuntu-24.04
environment: "stash-frontend"
defaults:
run:
working-directory: stash
Expand All @@ -82,12 +80,12 @@ jobs:
deploy-holesky:
name: Deploy `stash` to `holesky` environment
if: (github.event_name == 'workflow_dispatch' && github.event.inputs.environment == 'holesky') && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/'))
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
needs: build
defaults:
run:
working-directory: stash
environment: stash-holesky
environment: "stash-holesky"
env:
ENVIRONMENT: holesky
steps:
Expand All @@ -111,12 +109,12 @@ jobs:
deploy-prod:
name: Deploy `stash` to `prod` environment
if: (github.event_name == 'workflow_dispatch' && github.event.inputs.environment == 'prod') && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/'))
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
needs: build
defaults:
run:
working-directory: stash
environment: stash-prod
environment: "stash-prod"
env:
ENVIRONMENT: prod
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/faucet-deploy-app-engine.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ env:

jobs:
build-and-deploy:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04

steps:
- name: Checkout repository
Expand Down
86 changes: 71 additions & 15 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ permissions:
id-token: write
deployments: write
checks: write
security-events: write

# The following concurrency group cancels in-progress jobs or runs on pull_request events only
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value
Expand All @@ -19,35 +20,66 @@ jobs:
init:
name: Set global version
if: github.event.action != 'unlabeled' && github.event.action != 'closed'
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
outputs:
GLOBAL_VERSION: ${{ steps.set_vars.outputs.GLOBAL_VERSION }}
GIT_BRANCH: ${{ steps.set_vars.outputs.GIT_BRANCH }}
GIT_BRANCH_UNFORMATTED: ${{ steps.branch-name.outputs.current_branch }}
steps:
- name: Get branch name
id: branch-name
uses: tj-actions/branch-names@v8
- name: Set global version
id: set_vars
run: |
echo "GLOBAL_VERSION=${{ github.sha }}" >> $GITHUB_OUTPUT
echo "IMAGE TAG=${{ github.sha }}" >> $GITHUB_STEP_SUMMARY
echo "GIT_BRANCH=${{ steps.branch-name.outputs.current_branch }}" | sed "s@/@-@g" >> $GITHUB_OUTPUT
echo "IMAGE_TAG=${{ github.sha }}" >> $GITHUB_STEP_SUMMARY
build-and-test:
needs: [init]
name: Build
name: '[AVS services] Build'
uses: ./.github/workflows/reusable-build-and-test.yml
secrets: inherit
with:
version: ${{ needs.init.outputs.GLOBAL_VERSION }}

deploy-fungible:
name: Deploy fungible environment
if: |
(github.event_name == 'pull_request' && github.event.action == 'labeled' && github.event.label.name == ':rocket: deploy_fungible') ||
(github.event_name == 'pull_request' && github.event.action != 'labeled' && contains(github.event.pull_request.labels.*.name, ':rocket: deploy_fungible'))
needs: [init, build-and-test]
uses: ./.github/workflows/reusable-deploy.yml

build-and-test-gasp-node:
needs: [init]
name: '[gasp-node] Build'
uses: ./.github/workflows/reusable-gasp-node-build-and-test.yml
secrets: inherit
permissions:
contents: read
actions: read
checks: write
id-token: write
with:
version: ${{ needs.init.outputs.GLOBAL_VERSION }}
branch: ${{ needs.init.outputs.GIT_BRANCH }}

gasp-node-unit-tests-and-coverage:
name: '[gasp-node] Run unit tests and coverage'
needs: [init]
uses: ./.github/workflows/reusable-gasp-node-unit-tests-and-coverage.yml
secrets: inherit
permissions:
contents: read
actions: read
checks: write
id-token: write
with:
env: fungible
version: ${{ needs.init.outputs.GLOBAL_VERSION }}
branch: ${{ needs.init.outputs.GIT_BRANCH }}

gasp-node-generate-types:
name: '[gasp-node] Generate types'
needs: [init, build-and-test-gasp-node]
uses: ./.github/workflows/reusable-gasp-node-generate-types.yml
secrets: inherit
with:
branch: ${{ needs.init.outputs.GIT_BRANCH_UNFORMATTED }}
globalVersion: ${{ needs.init.outputs.GLOBAL_VERSION }}

run-e2e-test:
name: Run e2e tests
Expand All @@ -60,21 +92,45 @@ jobs:
checks: write
with:
globalVersion: ${{ needs.init.outputs.GLOBAL_VERSION }}

run-e2e-test-gasp-node:
name: '[gasp-node] Run e2e tests'
needs: [init, build-and-test-gasp-node, gasp-node-generate-types]
uses: ./.github/workflows/reusable-gasp-node-e2e-tests.yml
secrets: inherit
permissions:
contents: read
actions: read
checks: write
with:
globalVersion: ${{ needs.init.outputs.GLOBAL_VERSION }}

deploy-fungible:
name: Deploy fungible environment
if: |
(github.event_name == 'pull_request' && github.event.action == 'labeled' && github.event.label.name == ':rocket: deploy_fungible') ||
(github.event_name == 'pull_request' && github.event.action != 'labeled' && contains(github.event.pull_request.labels.*.name, ':rocket: deploy_fungible'))
needs: [init, build-and-test, build-and-test-gasp-node, gasp-node-unit-tests-and-coverage]
uses: ./.github/workflows/reusable-deploy.yml
secrets: inherit
with:
env: fungible
version: ${{ needs.init.outputs.GLOBAL_VERSION }}

clean-up-fungible:
name: Delete fungible environment
if: |
(github.event_name == 'pull_request' && github.event.action == 'unlabeled' && github.event.label.name == ':rocket: deploy_fungible') ||
(github.event_name == 'pull_request' && github.event.action == 'closed' && contains(github.event.pull_request.labels.*.name, ':rocket: deploy_fungible'))
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: google-github-actions/auth@v2
with:
workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ secrets.GCP_SERVICE_ACCOUNT }}
- name: Set up GKE credentials
uses: google-github-actions/get-gke-credentials@v0.8.2
uses: google-github-actions/get-gke-credentials@v2.3.0
with:
cluster_name: mangata-dev-alpha
location: europe-west1
Expand All @@ -84,7 +140,7 @@ jobs:

- name: Delete GitHub Deployment environment
if: always()
uses: bobheadxi/deployments@v1.4.0
uses: bobheadxi/deployments@v1.5.0
with:
step: deactivate-env
token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
Loading

0 comments on commit 12a1434

Please sign in to comment.