-
Notifications
You must be signed in to change notification settings - Fork 151
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(ci): backport ci changes to 1.3 (#2425)
Signed-off-by: Paul Schultz <pschultz@pobox.com>
- Loading branch information
1 parent
4ad206e
commit 9601b0a
Showing
8 changed files
with
170 additions
and
112 deletions.
There are no files selected for viewing
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
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
name: Pull Request | ||
|
||
on: pull_request | ||
|
||
env: | ||
TURBO_SCM_BASE: ${{ github.event.pull_request.base.sha }} | ||
TURBO_SCM_HEAD: ${{ github.sha }} | ||
|
||
# enforce only one action can run at a time for a given PR, and | ||
# when updating a PR, actions in progress will be cancelled to start a fresh one | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build: | ||
name: Build with Node.js ${{ matrix.node-version }} | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
node-version: [18, 20] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
registry-url: 'https://registry.npmjs.org' | ||
cache: 'yarn' | ||
|
||
- name: Setup local Turbo cache | ||
uses: dtinth/setup-github-actions-caching-for-turbo@cc723b4600e40a6b8815b65701d8614b91e2669e # v1 | ||
|
||
- name: Install dependencies | ||
run: | | ||
yarn install --frozen-lockfile | ||
- name: Build packages | ||
uses: ./.github/actions/build | ||
with: | ||
args: --affected | ||
|
||
test: | ||
name: Test with Node.js ${{ matrix.node-version }} | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
node-version: [18, 20] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
registry-url: 'https://registry.npmjs.org' | ||
cache: 'yarn' | ||
|
||
- name: Setup local Turbo cache | ||
uses: dtinth/setup-github-actions-caching-for-turbo@cc723b4600e40a6b8815b65701d8614b91e2669e # v1 | ||
|
||
- name: Install dependencies | ||
run: | | ||
yarn install --frozen-lockfile | ||
- name: Verify changesets | ||
run: | | ||
echo "Working in branch ${{ github.ref_name }}" | ||
if [[ "${{ github.ref_name }}" != *"changeset-release/"* ]]; then | ||
echo "Check changeset status since ${{ github.event.pull_request.base.sha }}" | ||
yarn changeset status --since=${{ github.event.pull_request.base.sha }} | ||
else | ||
echo "Skipped - changeset-release/* PR" | ||
fi | ||
- name: Test packages | ||
uses: ./.github/actions/test | ||
with: | ||
args: --affected |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
name: Update changeset PRs | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'changeset-release/**' | ||
|
||
# enforce only one release action per release branch at a time | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: false | ||
|
||
jobs: | ||
prev-commit: | ||
name: Verify previous commit | ||
runs-on: ubuntu-latest | ||
outputs: | ||
valid: ${{ steps.prev-commit.outputs.valid }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 | ||
|
||
# We do not want an infinite loop; therefore, we are checking if the previous | ||
# commit was created by this action. | ||
- name: Get previous commit message | ||
id: prev-commit | ||
run: | | ||
echo "valid=$(if [[ $(git log -1 --pretty=%B HEAD) != 'chore: update yarn.lock' ]]; then echo 'true'; else echo 'false'; fi)" >> $GITHUB_OUTPUT | ||
update-and-commit-files: | ||
name: Update and commit files | ||
needs: prev-commit | ||
if: needs.prev-commit.outputs.valid == 'true' | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Generate token | ||
id: generate-token | ||
uses: actions/create-github-app-token@31c86eb3b33c9b601a1f60f98dcbfd1d70f379b4 # v1.10.3 | ||
with: | ||
app-id: ${{ vars.JANUS_IDP_GITHUB_APP_ID }} | ||
private-key: ${{ secrets.JANUS_IDP_GITHUB_APP_PRIVATE_KEY }} | ||
|
||
- name: Checkout | ||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 | ||
with: | ||
token: ${{ steps.generate-token.outputs.token }} | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4 | ||
with: | ||
node-version-file: '.nvmrc' | ||
registry-url: 'https://registry.npmjs.org' | ||
|
||
- name: Install dependencies | ||
# We want to commit the yarn.lock changes | ||
run: yarn install | ||
|
||
- name: Clean export dynamic | ||
# We want a clean dynamic folder | ||
run: yarn run export-dynamic:clean --concurrency=75% --affected | ||
|
||
- name: Amend previous commit | ||
uses: stefanzweifel/git-auto-commit-action@v5 | ||
with: | ||
commit_message: 'chore: update yarn.lock' |
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