Skip to content

Commit

Permalink
CI Reorg (#78)
Browse files Browse the repository at this point in the history
* move combiner tests to be separate as they re long running, combine encrypted backup and identity as they are fast

* rename group to CI checks 

* require changeset to be present as part of lint

---------

Co-authored-by: Aaron <[email protected]>
  • Loading branch information
aaronmgdr and aaronmgdr authored Oct 6, 2023
1 parent 41249ab commit 3f1763a
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 39 deletions.
2 changes: 2 additions & 0 deletions .changeset/unlucky-scissors-wave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
71 changes: 32 additions & 39 deletions .github/workflows/circleci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: social connect
run-name: social connect tests
name: CI Checks
run-name: ci checks

# 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 Down Expand Up @@ -38,7 +38,7 @@ env:

jobs:
install-dependencies:
name: Install dependencies
name: Install + Build +
outputs:
package-json-checksum: ${{ steps.node-checksums.outputs.PACKAGE_JSON_CHECKSUM }}
# Propagate more outputs if you need https://github.com/tj-actions/changed-files#outputs
Expand Down Expand Up @@ -124,15 +124,6 @@ jobs:
if: steps.cache_node.outputs.cache-hit != 'true'
run: |
yarn check-licenses
- name: Detect files changed in PR, and expose as output
id: changed-files
uses: tj-actions/changed-files@v37
with:
# Using comma as separator to be able to easily match full paths (using ,<path>)
separator: ','
# Checking if changed in the last 100 commits in PRs
fetch_depth: '150'
- run: echo ",${{ steps.changed-files.outputs.all_modified_files }}"
lint-checks:
name: Lint code
runs-on: ['self-hosted', 'org', '8-cpu']
Expand All @@ -155,8 +146,20 @@ jobs:
package-json-checksum: ${{ needs.install-dependencies.outputs.package-json-checksum }}
- run: yarn run prettify:diff
- run: yarn run lint
- name: Detect files changed in PR, and expose as output
id: changed-files
uses: tj-actions/changed-files@v37
with:
# Using comma as separator to be able to easily match full paths (using ,<path>)
separator: ','
# Checking if changed in the last 100 commits in PRs
fetch_depth: '150'
- run: echo ",${{ steps.changed-files.outputs.all_modified_files }}"
- name: Has Changeset
id: changeset
run: yarn changeset status --since origin/main
general_test:
name: General jest test
name: General (identity + encrypted-backup) test
runs-on: ['self-hosted', 'org', '8-cpu']
container:
image: us-west1-docker.pkg.dev/devopsre/actions-runner-controller/celo-monorepo:node18
Expand All @@ -172,30 +175,28 @@ jobs:
uses: ./.github/actions/sync-workspace
with:
package-json-checksum: ${{ needs.install-dependencies.outputs.package-json-checksum }}
- name: Run Jest Tests
- name: Run Encrypted Backup tests
run: |
mkdir -p test-results/jest
# Skipping packages that are tested in a specific job below
yarn run lerna \
--ignore @celo/identity \
run test
yarn --cwd=packages/sdk/encrypted-backup test
- name: Run Identity Tests
run: |
yarn --cwd=packages/sdk/identity test
- name: Upload Jest Test Results
uses: actions/upload-artifact@v3
with:
name: Jest Test Results
path: test-results/jest


identity-tests:
name: Identity Tests
combiner-test:
name: Combiner test
runs-on: ['self-hosted', 'org', '8-cpu']
container:
image: us-west1-docker.pkg.dev/devopsre/actions-runner-controller/celo-monorepo:node18
timeout-minutes: 30
needs: [install-dependencies]
needs: install-dependencies
if: |
github.base_ref == 'main' || contains(github.base_ref, 'staging') || contains(github.base_ref, 'production') ||
contains(needs.install-dependencies.outputs.all_modified_files, 'packages/phone-number-privacy/common') ||
contains(needs.install-dependencies.outputs.all_modified_files, 'packages/phone-number-privacy/combiner') ||
contains(needs.install-dependencies.outputs.all_modified_files, ',package.json') ||
contains(needs.install-dependencies.outputs.all_modified_files, ',yarn.lock') ||
false
steps:
Expand All @@ -209,25 +210,20 @@ jobs:
uses: ./.github/actions/sync-workspace
with:
package-json-checksum: ${{ needs.install-dependencies.outputs.package-json-checksum }}
#- name: Generate DevChain
# run: |
# cd packages/sdk/identity
# yarn test:reset
- name: Run tests
- name: Run Tests for combiner
run: |
yarn --cwd=packages/sdk/identity test
yarn --cwd=packages/phone-number-privacy/combiner test:coverage
odis-test:
name: ODIS test
name: ODIS (signer + common) test
needs: install-dependencies
runs-on: ['self-hosted', 'org', '8-cpu']
container:
image: us-west1-docker.pkg.dev/devopsre/actions-runner-controller/celo-monorepo:node18
timeout-minutes: 30
needs: [install-dependencies, lint-checks]

if: |
github.base_ref == 'main' || contains(github.base_ref, 'staging') || contains(github.base_ref, 'production') ||
contains(needs.install-dependencies.outputs.all_modified_files, 'packages/phone-number-privacy') ||
contains(needs.install-dependencies.outputs.all_modified_files, 'packages/protocol') ||
contains(needs.install-dependencies.outputs.all_modified_files, 'packages/sdk') ||
contains(needs.install-dependencies.outputs.all_modified_files, ',package.json') ||
contains(needs.install-dependencies.outputs.all_modified_files, ',yarn.lock') ||
false
Expand All @@ -245,9 +241,6 @@ jobs:
- name: Run Tests for common package
run: |
yarn --cwd=packages/phone-number-privacy/common test:coverage
- name: Run Tests for combiner
run: |
yarn --cwd=packages/phone-number-privacy/combiner test:coverage
- name: Run Tests for signer
run: |
yarn --cwd=packages/phone-number-privacy/signer test:coverage
yarn --cwd=packages/phone-number-privacy/signer test:coverage

0 comments on commit 3f1763a

Please sign in to comment.