Skip to content

Commit

Permalink
GitHub Workflow refactor. Run in org-runners (#10649)
Browse files Browse the repository at this point in the history
* GitHub Workflow refactor. Run in org-runners
* Remove reference to phone-number-privacy dockerfile
* Running pre-protocol-test-release as root
* Fix git file permission error
* Updated to "stable" runner image
  • Loading branch information
jcortejoso authored Oct 13, 2023
1 parent b102059 commit 177197d
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 28 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: celo-monorepo
run-name: celo-monorepo tests
name: celo-monorepo CI/CD
run-name: celo-monorepo CI/CD for ${{ github.head_ref || github.ref_name }}

# Dockefile for the self-hosted runner:
# https://github.com/celo-org/infrastructure/blob/master/terraform/root-modules/gcp/integration-tests-gke/files/github-arc/Dockerfile-monorepo
Expand All @@ -17,7 +17,7 @@ on:
- '**/*.md'

concurrency:
group: circle-ci-${{ github.ref }}
group: celo-monorepo-${{ github.ref }}
cancel-in-progress: true

defaults:
Expand All @@ -26,7 +26,7 @@ defaults:

env:
# Increment these to force cache rebuilding
NODE_MODULE_CACHE_VERSION: 3
NODE_MODULE_CACHE_VERSION: 4
NODE_OPTIONS: '--max-old-space-size=4096'
TERM: dumb
GRADLE_OPTS: '-Dorg.gradle.daemon=false -Dorg.gradle.parallel=false -Dorg.gradle.configureondemand=true -Dorg.gradle.jvmargs="-Xmx4096m -XX:+HeapDumpOnOutOfMemoryError"'
Expand All @@ -45,7 +45,10 @@ jobs:
# Adding a initial comma so ',<path>' matches also for the first file
all_modified_files: ',${{ steps.changed-files.outputs.all_modified_files }}'
# runs-on: ubuntu-latest
runs-on: ['self-hosted', 'monorepo-node18']
runs-on: ['self-hosted', 'org', '8-cpu']
container:
# Update image at https://github.com/celo-org/infrastructure/blob/master/terraform/root-modules/gcp/integration-tests-gke/files/github-arc/Dockerfiles/Dockerfile-monorepo
image: us-west1-docker.pkg.dev/devopsre/actions-runner-controller/celo-monorepo:node18
timeout-minutes: 30
steps:
- name: Restore .git cache
Expand Down Expand Up @@ -121,7 +124,7 @@ jobs:
run: |
# This fails if there is any change
if ! git diff-index HEAD --; then
echo "Git changes detected while building. If this is unexpected, bump NODE_MODULE_CACHE_VERSION in .github/workflows/circleci.yml"
echo "Git changes detected while building. If this is unexpected, bump NODE_MODULE_CACHE_VERSION in .github/workflows/celo-monorepo.yml"
exit 1
fi
- name: Build packages
Expand All @@ -141,7 +144,10 @@ jobs:
- run: echo ",${{ steps.changed-files.outputs.all_modified_files }}"
lint-checks:
name: Lint code
runs-on: ['self-hosted', 'monorepo-node18']
runs-on: ['self-hosted', 'org', '8-cpu']
container:
# Update image at https://github.com/celo-org/infrastructure/blob/master/terraform/root-modules/gcp/integration-tests-gke/files/github-arc/Dockerfiles/Dockerfile-monorepo
image: us-west1-docker.pkg.dev/devopsre/actions-runner-controller/celo-monorepo:node18
timeout-minutes: 30
needs: install-dependencies
steps:
Expand All @@ -161,7 +167,10 @@ jobs:
- run: yarn run lint
general_test:
name: General jest test
runs-on: ['self-hosted', 'monorepo-node18']
runs-on: ['self-hosted', 'org', '8-cpu']
container:
# Update image at https://github.com/celo-org/infrastructure/blob/master/terraform/root-modules/gcp/integration-tests-gke/files/github-arc/Dockerfiles/Dockerfile-monorepo
image: us-west1-docker.pkg.dev/devopsre/actions-runner-controller/celo-monorepo:node18
needs: install-dependencies
steps:
- uses: actions/cache/restore@v3
Expand Down Expand Up @@ -194,7 +203,10 @@ jobs:
path: test-results/jest
wallet-test:
name: Wallet test
runs-on: ['self-hosted', 'monorepo-node18']
runs-on: ['self-hosted', 'org', '8-cpu']
container:
# Update image at https://github.com/celo-org/infrastructure/blob/master/terraform/root-modules/gcp/integration-tests-gke/files/github-arc/Dockerfiles/Dockerfile-monorepo
image: us-west1-docker.pkg.dev/devopsre/actions-runner-controller/celo-monorepo:node18
timeout-minutes: 30
needs: install-dependencies
steps:
Expand All @@ -213,7 +225,12 @@ jobs:
yarn run lerna --scope '@celo/wallet-*' run test
pre-protocol-test-release:
name: Protocol Tests Prepare
runs-on: ['self-hosted', 'monorepo-node18']
runs-on: ['self-hosted', 'org', '8-cpu']
container:
# Update image at https://github.com/celo-org/infrastructure/blob/master/terraform/root-modules/gcp/integration-tests-gke/files/github-arc/Dockerfiles/Dockerfile-monorepo
image: us-west1-docker.pkg.dev/devopsre/actions-runner-controller/celo-monorepo:node18
# Required root to install node12
options: --user root
timeout-minutes: 30
# Comment lint-checks dependency to speed up (as this is a dependency for many other jobs)
# needs: [install-dependencies, lint-checks]
Expand Down Expand Up @@ -253,6 +270,9 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: 12.22.11
# Workaround for https://stackoverflow.com/questions/72978485/git-submodule-update-failed-with-fatal-detected-dubious-ownership-in-repositor
- name: Configure git safe directories
run: git config --global --add safe.directory '*'
- name: Generate devchain of previous release
run: |
echo "Comparing against $RELEASE_TAG"
Expand All @@ -262,7 +282,10 @@ jobs:
yarn --cwd packages/protocol test:generate-old-devchain-and-build -b $RELEASE_TAG -d .tmp/released_chain -l /dev/stdout -g scripts/truffle/releaseGoldExampleConfigs.json
protocol-test-release:
name: Protocol Test Release
runs-on: ['self-hosted', 'monorepo-node18']
runs-on: ['self-hosted', 'org', '8-cpu']
container:
# Update image at https://github.com/celo-org/infrastructure/blob/master/terraform/root-modules/gcp/integration-tests-gke/files/github-arc/Dockerfiles/Dockerfile-monorepo
image: us-west1-docker.pkg.dev/devopsre/actions-runner-controller/celo-monorepo:node18
timeout-minutes: 30
needs: [install-dependencies, lint-checks, pre-protocol-test-release]
if: |
Expand Down Expand Up @@ -296,7 +319,10 @@ jobs:
protocol-test-matrix:
# Keeping name short because GitHub UI does not handle long names well
name: ${{ matrix.name }}
runs-on: ['self-hosted', 'monorepo-node18']
runs-on: ['self-hosted', 'org', '8-cpu']
container:
# Update image at https://github.com/celo-org/infrastructure/blob/master/terraform/root-modules/gcp/integration-tests-gke/files/github-arc/Dockerfiles/Dockerfile-monorepo
image: us-west1-docker.pkg.dev/devopsre/actions-runner-controller/celo-monorepo:node18
timeout-minutes: 60
needs: [install-dependencies, lint-checks]
if: |
Expand Down Expand Up @@ -373,7 +399,10 @@ jobs:
${{ matrix.command }}
contractkit-tests:
name: ContractKit Tests
runs-on: ['self-hosted', 'monorepo-node18']
runs-on: ['self-hosted', 'org', '8-cpu']
container:
# Update image at https://github.com/celo-org/infrastructure/blob/master/terraform/root-modules/gcp/integration-tests-gke/files/github-arc/Dockerfiles/Dockerfile-monorepo
image: us-west1-docker.pkg.dev/devopsre/actions-runner-controller/celo-monorepo:node18
timeout-minutes: 30
needs: [install-dependencies]
if: |
Expand Down Expand Up @@ -405,7 +434,10 @@ jobs:
yarn --cwd=packages/sdk/contractkit test
cli-tests:
name: CeloCli Tests
runs-on: ['self-hosted', 'monorepo-node18']
runs-on: ['self-hosted', 'org', '8-cpu']
container:
# Update image at https://github.com/celo-org/infrastructure/blob/master/terraform/root-modules/gcp/integration-tests-gke/files/github-arc/Dockerfiles/Dockerfile-monorepo
image: us-west1-docker.pkg.dev/devopsre/actions-runner-controller/celo-monorepo:node18
timeout-minutes: 30
needs: [install-dependencies]
if: |
Expand Down Expand Up @@ -449,7 +481,10 @@ jobs:
yarn --cwd=packages/cli run celocli account:new
typescript-tests:
name: Typescript package Tests
runs-on: ['self-hosted', 'monorepo-node18']
runs-on: ['self-hosted', 'org', '8-cpu']
container:
# Update image at https://github.com/celo-org/infrastructure/blob/master/terraform/root-modules/gcp/integration-tests-gke/files/github-arc/Dockerfiles/Dockerfile-monorepo
image: us-west1-docker.pkg.dev/devopsre/actions-runner-controller/celo-monorepo:node18
timeout-minutes: 30
needs: [install-dependencies]
if: |
Expand Down Expand Up @@ -478,7 +513,10 @@ jobs:
npm install $RUNNER_WORKSPACE/celo-monorepo/packages/typescript/*.tgz
base-test:
name: SDK Base package Tests
runs-on: ['self-hosted', 'monorepo-node18']
runs-on: ['self-hosted', 'org', '8-cpu']
container:
# Update image at https://github.com/celo-org/infrastructure/blob/master/terraform/root-modules/gcp/integration-tests-gke/files/github-arc/Dockerfiles/Dockerfile-monorepo
image: us-west1-docker.pkg.dev/devopsre/actions-runner-controller/celo-monorepo:node18
timeout-minutes: 30
needs: [install-dependencies]
if: |
Expand Down Expand Up @@ -514,7 +552,10 @@ jobs:
npm install $RUNNER_WORKSPACE/celo-monorepo/packages/sdk/base/*.tgz
utils-test:
name: SDK Utils package Tests
runs-on: ['self-hosted', 'monorepo-node18']
runs-on: ['self-hosted', 'org', '8-cpu']
container:
# Update image at https://github.com/celo-org/infrastructure/blob/master/terraform/root-modules/gcp/integration-tests-gke/files/github-arc/Dockerfiles/Dockerfile-monorepo
image: us-west1-docker.pkg.dev/devopsre/actions-runner-controller/celo-monorepo:node18
timeout-minutes: 30
needs: [install-dependencies]
if: |
Expand Down Expand Up @@ -549,7 +590,10 @@ jobs:
end-to-end-geth-matrix:
# Keeping name short because GitHub UI does not handle long names well
name: e2e ${{ matrix.name }}
runs-on: ['self-hosted', 'monorepo-node18']
runs-on: ['self-hosted', 'org', '8-cpu']
container:
# Update image at https://github.com/celo-org/infrastructure/blob/master/terraform/root-modules/gcp/integration-tests-gke/files/github-arc/Dockerfiles/Dockerfile-monorepo
image: us-west1-docker.pkg.dev/devopsre/actions-runner-controller/celo-monorepo:node18
timeout-minutes: 60
needs: [install-dependencies, lint-checks, contractkit-tests]
if: |
Expand Down Expand Up @@ -646,7 +690,10 @@ jobs:
# NOTE: This has not been fully tested as we don't have a license for certora
certora-test:
name: Certora test ${{ matrix.name }}
runs-on: ['self-hosted', 'monorepo-node18']
runs-on: ['self-hosted', 'org', '8-cpu']
container:
# Update image at https://github.com/celo-org/infrastructure/blob/master/terraform/root-modules/gcp/integration-tests-gke/files/github-arc/Dockerfiles/Dockerfile-monorepo
image: us-west1-docker.pkg.dev/devopsre/actions-runner-controller/celo-monorepo:node18
timeout-minutes: 30
needs: [install-dependencies, lint-checks]
# Disable as certora license is not active
Expand Down
9 changes: 0 additions & 9 deletions cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,6 @@ steps:
]
waitFor: ['-']

- id: "docker:phone-number-privacy-signer"
name: gcr.io/kaniko-project/executor:v0.16.0
args: [
"--dockerfile=dockerfiles/phone-number-privacy/Dockerfile",
"--cache=true",
"--destination=us.gcr.io/$PROJECT_ID/celo-monorepo:phone-number-privacy-$COMMIT_SHA"
]
waitFor: ['-']

options:
machineType: 'N1_HIGHCPU_8'

Expand Down

0 comments on commit 177197d

Please sign in to comment.