-
Notifications
You must be signed in to change notification settings - Fork 48
SDKS-4448: Update CI/CD #551
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
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,76 @@ | ||
| name: Setup publish | ||
| description: Setup steps for publishing packages | ||
|
|
||
| inputs: | ||
| branch: | ||
| required: true | ||
|
|
||
| runs: | ||
| using: 'composite' | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
| ref: ${{ inputs.branch }} | ||
|
|
||
| - name: Install pnpm | ||
| uses: pnpm/action-setup@v4 | ||
| with: | ||
| run_install: false # don't install any packages yet | ||
|
|
||
| - name: Install Node.js | ||
| uses: actions/setup-node@v4 | ||
| id: cache | ||
| with: | ||
| node-version: '.node-version' | ||
| cache: 'pnpm' # package manager for caching | ||
| registry-url: 'https://registry.npmjs.org' | ||
|
|
||
| # Update npm to latest for provenance | ||
| - name: Update npm | ||
| run: npm install -g npm@latest | ||
|
|
||
| - name: Install dependencies from lockfile | ||
| run: pnpm install --frozen-lockfile | ||
|
|
||
| # Allocate nx tasks across multiple machines/agents in the cloud | ||
| # The "--stop-agents-after" is optional, but allows idle agents to shut down once the "e2e-ci" targets have been requested | ||
| # https://nx.dev/docs/features/ci-features/distribute-task-execution | ||
| - name: Enable distribution of nx tasks to cloud agents | ||
| run: pnpm dlx nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="e2e-ci" --with-env-vars="CODECOV_TOKEN" | ||
| env: | ||
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | ||
|
|
||
| # https://github.com/microsoft/playwright/issues/7249#issuecomment-1256878540 | ||
| - name: Cache Playwright browsers | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: ~/.cache/ms-playwright | ||
| key: ${{ runner.os }}-playwright-${{ hashFiles('**/pnpm-lock.yaml') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-playwright- | ||
| - name: Install Playwright browsers | ||
| run: pnpm exec playwright install | ||
|
|
||
| - name: Derive SHAs for `nx affected` | ||
| uses: nrwl/nx-set-shas@v4 | ||
| with: | ||
| main-branch-name: master | ||
|
|
||
| - name: Run build, lint, test, and e2e for projects changed | ||
| run: pnpm exec nx affected -t build lint test e2e-ci --agents | ||
|
|
||
| - name: Save Playwright test results | ||
| uses: actions/upload-artifact@v4 | ||
| if: ${{ !cancelled() }} | ||
| with: | ||
| name: playwright-report | ||
| path: | | ||
| ./dist/.playwright/** | ||
| ./dist/** | ||
| retention-days: 30 | ||
|
|
||
| - name: Ensure builds for all packages before publishing | ||
| run: pnpm exec nx run-many -t build --no-agents # --no-agents to run in CI without distributing to agents | ||
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,57 @@ | ||
| name: ForgeRock Fork Pull Request CI | ||
|
|
||
| on: | ||
| pull_request: | ||
|
|
||
| permissions: | ||
| contents: read | ||
| actions: read | ||
|
|
||
| concurrency: | ||
| group: pr-${{ github.event.pull_request.number }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| pr: | ||
| # Only run for forks | ||
| if: ${{ github.event.pull_request.head.repo.full_name != github.repository }} | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 20 | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| # head commit is fine; the default merge ref also works on pull_request | ||
| ref: ${{ github.event.pull_request.head.sha }} | ||
| fetch-depth: 0 | ||
|
|
||
| - uses: pnpm/action-setup@v4 | ||
| with: | ||
| run_install: false | ||
|
|
||
| - uses: actions/setup-node@v4 | ||
| with: | ||
| node-version-file: '.node-version' | ||
| cache: 'pnpm' | ||
| cache-dependency-path: '**/pnpm-lock.yaml' | ||
|
|
||
| - run: pnpm install --frozen-lockfile | ||
|
|
||
| # Restore-only cache to avoid save attempts/noise on forks | ||
| - name: Restore Playwright browsers cache | ||
| uses: actions/cache/restore@v4 | ||
| with: | ||
| path: ~/.cache/ms-playwright | ||
| key: ${{ runner.os }}-playwright-${{ hashFiles('**/pnpm-lock.yaml') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-playwright- | ||
|
|
||
| - run: pnpm exec playwright install --with-deps | ||
|
|
||
| - uses: nrwl/nx-set-shas@v4 | ||
|
|
||
| # Needed so nx affected can diff against main | ||
| - run: git branch --track main origin/main || true | ||
|
|
||
| - run: pnpm nx format:check | ||
| - run: pnpm nx affected -t build typecheck lint test e2e-ci |
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
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 |
|---|---|---|
| @@ -1 +1 @@ | ||
| v20 | ||
| 20 |
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.