-
Notifications
You must be signed in to change notification settings - Fork 90
chore: add caching to CI's JS workflows #1806
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
Closed
Closed
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
3bd22b1
chore: backport breaking api changes to v1 js SDKs (#1661)
SwenSchaeferjohann 4f52bde
rm conflict in lockfile
SwenSchaeferjohann 5b5cbdb
fix lint
SwenSchaeferjohann acff477
wip
SwenSchaeferjohann 0926e6f
wip
SwenSchaeferjohann c14b05c
simplify build for ci
SwenSchaeferjohann 6d2b6f4
wip
SwenSchaeferjohann 95251d5
wip
SwenSchaeferjohann 3de8d4b
wip
SwenSchaeferjohann 6532114
rm nx cache again
SwenSchaeferjohann 107bcc2
improve logging if prover exists with code 1
SwenSchaeferjohann 5d406f1
fix cli yml
SwenSchaeferjohann ab686f5
wip
SwenSchaeferjohann 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,89 @@ | ||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| pull_request: | ||
| branches: | ||
| - "*" | ||
| types: | ||
| - opened | ||
| - synchronize | ||
| - reopened | ||
| - ready_for_review | ||
|
|
||
| name: cli-tests-v1 | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| cli-v1: | ||
| name: cli-v1 | ||
| if: github.event.pull_request.draft == false | ||
| runs-on: ubuntu-latest | ||
|
|
||
| services: | ||
| redis: | ||
| image: redis:8.0.1 | ||
| ports: | ||
| - 6379:6379 | ||
| options: >- | ||
| --health-cmd "redis-cli ping" | ||
| --health-interval 10s | ||
| --health-timeout 5s | ||
| --health-retries 5 | ||
|
|
||
| env: | ||
| LIGHT_PROTOCOL_VERSION: V1 | ||
| REDIS_URL: redis://localhost:6379 | ||
| CI: true | ||
|
|
||
| steps: | ||
| - name: Checkout sources | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Cache nx | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: | | ||
| .nx/cache | ||
| node_modules/.cache/nx | ||
| js/stateless.js/node_modules/.cache/nx | ||
| js/compressed-token/node_modules/.cache/nx | ||
| cli/node_modules/.cache/nx | ||
| key: nx-cli-v1-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml', 'js/**/package.json', 'cli/package.json') }}-${{ github.sha }} | ||
| restore-keys: | | ||
| nx-cli-v1-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml', 'js/**/package.json', 'cli/package.json') }}- | ||
| nx-cli-v1-${{ runner.os }}- | ||
|
|
||
| - name: Setup and build | ||
| uses: ./.github/actions/setup-and-build | ||
|
|
||
| - name: Build stateless.js with V1 | ||
| run: | | ||
| source ./scripts/devenv.sh | ||
| cd js/stateless.js | ||
| pnpm build:v1 | ||
|
|
||
| - name: Build compressed-token with V1 | ||
| run: | | ||
| source ./scripts/devenv.sh | ||
| cd js/compressed-token | ||
| pnpm build:v1 | ||
|
|
||
| - name: Build CLI with V1 | ||
| run: | | ||
| source ./scripts/devenv.sh | ||
| npx nx build @lightprotocol/zk-compression-cli | ||
|
|
||
| - name: Run CLI tests with V1 | ||
| run: | | ||
| source ./scripts/devenv.sh | ||
| npx nx test @lightprotocol/zk-compression-cli | ||
|
|
||
| - name: Display prover logs on failure | ||
| if: failure() | ||
| run: | | ||
| echo "=== Displaying prover logs ===" | ||
| find cli/test-ledger -name "*prover*.log" -type f -exec echo "=== Contents of {} ===" \; -exec cat {} \; -exec echo "=== End of {} ===" \; || echo "No prover logs found" | ||
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,89 @@ | ||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| pull_request: | ||
| branches: | ||
| - "*" | ||
| types: | ||
| - opened | ||
| - synchronize | ||
| - reopened | ||
| - ready_for_review | ||
|
|
||
| name: cli-tests-v2 | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| cli-v2: | ||
| name: cli-v2 | ||
| if: github.event.pull_request.draft == false | ||
| runs-on: ubuntu-latest | ||
|
|
||
| services: | ||
| redis: | ||
| image: redis:8.0.1 | ||
| ports: | ||
| - 6379:6379 | ||
| options: >- | ||
| --health-cmd "redis-cli ping" | ||
| --health-interval 10s | ||
| --health-timeout 5s | ||
| --health-retries 5 | ||
|
|
||
| env: | ||
| LIGHT_PROTOCOL_VERSION: V2 | ||
| REDIS_URL: redis://localhost:6379 | ||
| CI: true | ||
|
|
||
| steps: | ||
| - name: Checkout sources | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Cache nx | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: | | ||
| .nx/cache | ||
| node_modules/.cache/nx | ||
| js/stateless.js/node_modules/.cache/nx | ||
| js/compressed-token/node_modules/.cache/nx | ||
| cli/node_modules/.cache/nx | ||
| key: nx-cli-v2-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml', 'js/**/package.json', 'cli/package.json') }}-${{ github.sha }} | ||
| restore-keys: | | ||
| nx-cli-v2-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml', 'js/**/package.json', 'cli/package.json') }}- | ||
| nx-cli-v2-${{ runner.os }}- | ||
|
|
||
| - name: Setup and build | ||
| uses: ./.github/actions/setup-and-build | ||
|
|
||
| - name: Build stateless.js with V2 | ||
| run: | | ||
| source ./scripts/devenv.sh | ||
| cd js/stateless.js | ||
| pnpm build:v2 | ||
|
|
||
| - name: Build compressed-token with V2 | ||
| run: | | ||
| source ./scripts/devenv.sh | ||
| cd js/compressed-token | ||
| pnpm build:v2 | ||
|
|
||
| - name: Build CLI with V2 | ||
| run: | | ||
| source ./scripts/devenv.sh | ||
| npx nx build @lightprotocol/zk-compression-cli | ||
|
|
||
| - name: Run CLI tests with V2 | ||
| run: | | ||
| source ./scripts/devenv.sh | ||
| npx nx test @lightprotocol/zk-compression-cli | ||
|
|
||
| - name: Display prover logs on failure | ||
| if: failure() | ||
| run: | | ||
| echo "=== Displaying prover logs ===" | ||
| find . -path "*/test-ledger/*prover*.log" -type f -exec echo "=== Contents of {} ===" \; -exec cat {} \; -exec echo "=== End of {} ===" \; || echo "No prover logs found" | ||
|
||
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,94 @@ | ||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| pull_request: | ||
| branches: | ||
| - "*" | ||
| types: | ||
| - opened | ||
| - synchronize | ||
| - reopened | ||
| - ready_for_review | ||
|
|
||
| name: js-tests-v2 | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| stateless-js-v2: | ||
| name: stateless-js-v2 | ||
| if: github.event.pull_request.draft == false | ||
| runs-on: ubuntu-latest | ||
|
|
||
| services: | ||
| redis: | ||
| image: redis:8.0.1 | ||
| ports: | ||
| - 6379:6379 | ||
| options: >- | ||
| --health-cmd "redis-cli ping" | ||
| --health-interval 10s | ||
| --health-timeout 5s | ||
| --health-retries 5 | ||
|
|
||
| env: | ||
| LIGHT_PROTOCOL_VERSION: V2 | ||
| REDIS_URL: redis://localhost:6379 | ||
| CI: true | ||
|
|
||
| steps: | ||
| - name: Checkout sources | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Cache nx | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: | | ||
| .nx/cache | ||
| node_modules/.cache/nx | ||
| js/stateless.js/node_modules/.cache/nx | ||
| js/compressed-token/node_modules/.cache/nx | ||
| cli/node_modules/.cache/nx | ||
| key: nx-js-v2-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml', 'js/**/package.json', 'cli/package.json') }}-${{ github.sha }} | ||
| restore-keys: | | ||
| nx-js-v2-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml', 'js/**/package.json', 'cli/package.json') }}- | ||
| nx-js-v2-${{ runner.os }}- | ||
|
|
||
| - name: Setup and build | ||
| uses: ./.github/actions/setup-and-build | ||
|
|
||
| - name: Build stateless.js with V2 | ||
| run: | | ||
| source ./scripts/devenv.sh | ||
| cd js/stateless.js | ||
| pnpm build:v2 | ||
|
|
||
| - name: Build compressed-token with V2 | ||
| run: | | ||
| source ./scripts/devenv.sh | ||
| cd js/compressed-token | ||
| pnpm build:v2 | ||
|
|
||
| - name: Build CLI | ||
| run: | | ||
| source ./scripts/devenv.sh | ||
| npx nx build @lightprotocol/zk-compression-cli | ||
|
|
||
| - name: Run stateless.js tests with V2 | ||
| run: | | ||
| source ./scripts/devenv.sh | ||
| npx nx test @lightprotocol/stateless.js | ||
|
|
||
| - name: Run compressed-token tests with V2 | ||
| run: | | ||
| source ./scripts/devenv.sh | ||
| npx nx test @lightprotocol/compressed-token | ||
|
|
||
| - name: Display prover logs on failure | ||
| if: failure() | ||
| run: | | ||
| echo "=== Displaying prover logs ===" | ||
| find . -path "*/test-ledger/*prover*.log" -type f -exec echo "=== Contents of {} ===" \; -exec cat {} \; -exec echo "=== End of {} ===" \; || echo "No prover logs found" | ||
|
||
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
Oops, something went wrong.
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.