generated from emunhoz/monorepo-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #27 from ngraveio/release-pipeline
feat: add release pipeline and update test/lint pipelines
- Loading branch information
Showing
5 changed files
with
89 additions
and
46 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 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,38 @@ | ||
name: Sync main with release | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
sync-main-branch: | ||
runs-on: ubuntu-22.04 | ||
permissions: | ||
contents: read | ||
pull-requests: write | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v4 | ||
|
||
- name: Create PR from release to main | ||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
run: | | ||
# Check if a pull request already exists from release to main | ||
pr_url=$(gh pr list --head release --base main --json url --jq '.[0].url') | ||
if [ -n "$pr_url" ]; then | ||
echo "PR already exists: $pr_url" | ||
else | ||
pr_url=$(gh pr create \ | ||
--head release \ | ||
--base main \ | ||
--title "[skip ci][skip release] Sync main with the release branch" \ | ||
--body "Auto-created pull request to merge changes from release into main." | ||
) | ||
echo "Created PR: $pr_url" | ||
fi | ||
# Attempt to merge the pull request (Fails, investigate later) | ||
# gh pr merge "$pr_url" --merge --auto |
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 |
---|---|---|
@@ -1,42 +1,28 @@ | ||
name: Test | ||
|
||
on: | ||
push: | ||
pull_request: | ||
|
||
jobs: | ||
test: | ||
name: Test | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v3 | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 18.x | ||
node-version: '20.x' | ||
|
||
- name: Install dependencies | ||
run: yarn | ||
|
||
- name: Run test over the merged changes | ||
run: | | ||
git config --global user.email "github-actions[bot]@users.noreply.github.com" | ||
git config --global user.name "github-actions[bot]" | ||
git checkout $GITHUB_BASE_REF | ||
git merge --no-commit --no-edit ${{ github.event.pull_request.head.sha }} | ||
yarn | ||
yarn lerna run build | ||
yarn test | ||
if: github.event_name == 'pull_request' | ||
- name: Run build | ||
run: yarn lerna run build | ||
|
||
- name: Test | ||
run: | | ||
yarn lerna run build | ||
yarn test | ||
if: github.event_name != 'pull_request' | ||
- name: Run test | ||
run: yarn test | ||
|
||
- name: Upload coverage reports to Codecov | ||
uses: codecov/codecov-action@v3 | ||
uses: codecov/codecov-action@v3 |
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