Merge pull request #431 from ForgeRock/develop #204
This file contains 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
name: ForgeRock Ubuntu CI | |
on: | |
push: | |
branches: | |
- develop | |
- master | |
workflow_dispatch: | |
env: | |
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }} | |
NX_CLOUD_ENCRYPTION_KEY: ${{ secrets.NX_CLOUD_ENCRYPTION_KEY }} | |
NX_CLOUD_DISTRIBUTED_EXECUTION: true | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
GH_TOKEN: ${{ secrets.GH_TOKEN }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
HUSKY: 0 | |
concurrency: ${{ github.workflow }}-${{ github.ref }} | |
jobs: | |
merge: | |
runs-on: ubuntu-latest # we run on ubuntu because some actions in this job do not work on mac | |
steps: | |
- name: Checkout Merged Branch | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
token: ${{ secrets.GH_TOKEN }} | |
- uses: actions/setup-node@v3 | |
id: cache | |
with: | |
node-version: '18.x' | |
cache: 'npm' | |
cache-dependency-path: '**/package-lock.json' | |
registry-url: https://registry.npmjs.org | |
- run: npm ci | |
- name: Derive appropriate SHAs for base and head for `nx affected` commands | |
id: sha | |
uses: nrwl/nx-set-shas@v2 | |
- run: npx nx-cloud start-ci-run | |
- run: npx nx affected --target=build --parallel --max-parallel=3 | |
- run: npx nx-cloud stop-all-agents | |
- name: Import GPG | |
uses: crazy-max/[email protected] | |
with: | |
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} | |
git_user_signingkey: true | |
git_commit_gpgsign: true | |
git_committer_email: '[email protected]' | |
git_push_gpgsign: false | |
git_config_global: true | |
# - name: Version Stable Release | |
# if: github.ref == 'refs/heads/master' | |
# run: | | |
# node ./scripts/update-package-json-workspaces.js | |
# npm install | |
# npx changeset version | |
# npx changeset tag | |
# npx changeset publish | |
# node ./scripts/remove-workspaces-edits.js | |
# npm install | |
# git config --global user.name "github-actions[bot]" | |
# git add . | |
# git commit -m "chore: version packages [skip ci]" | |
# git push --follow-tags | |
# git checkout develop | |
# git rebase master | |
# git push -f | |
# env: | |
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
# GH_TOKEN: ${{ secrets.GH_TOKEN }} | |
# NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
# HUSKY: 0 | |
# NX_CLOUD_DISTRIBUTED_EXECUTION: false | |
- name: Send a Slack notification if a publish happens | |
if: steps.changesets.outputs.published == 'true' | |
uses: slackapi/[email protected] | |
with: | |
payload: | | |
{ | |
"packages": ${{ steps.changesets.outputs.publishedPackages }} | |
} | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.SDK_WEBHOOK }} | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@v2 | |
if: always() | |
with: | |
name: 'E2E Artifacts' | |
retention-days: 5 | |
path: | | |
${{ github.workspace }}/e2e/**/test-results | |
test-results | |
${{ github.workspace }}/test-results | |
agents: | |
runs-on: ubuntu-latest | |
name: Agent Ubuntu | |
strategy: | |
matrix: | |
agent: [1, 2, 3] | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.event.pull_request.head.ref }} | |
repository: ${{github.event.pull_request.head.repo.full_name}} | |
fetch-depth: 0 | |
- uses: actions/setup-node@v3 | |
id: cache | |
with: | |
node-version: '18.x' | |
cache: 'npm' | |
cache-dependency-path: '**/package-lock.json' | |
registry-url: https://registry.npmjs.org | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: Import GPG | |
uses: crazy-max/[email protected] | |
with: | |
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} | |
git_user_signingkey: true | |
git_commit_gpgsign: true | |
git_committer_email: '[email protected]' | |
git_push_gpgsign: false | |
git_config_global: true | |
- name: Configure CI Git User | |
run: | | |
git config --global user.name 'release' | |
git remote set-url origin https://ryanbas21:[email protected]/ForgeRock/forgerock-javascript-sdk | |
- run: npm ci | |
if: steps.cache.outputs.cache-hit != 'true' | |
env: | |
PLAYWRIGHT_SKIP_BROWSERS_DOWNLOAD: 1 | |
- run: npm install @nrwl/nx-cloud | |
- name: Start Nx Agent ${{ matrix.agent }} | |
run: npx nx-cloud start-agent |