This repository has been archived by the owner on Nov 4, 2024. It is now read-only.
deps: update dependency @types/node to ^18.19.55 #134
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: Continuous Integration | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
env: | |
CI: 1 | |
ARTIFACT_DIR: ./artifacts | |
jobs: | |
commit-watch: | |
name: Run Commit Watch | |
runs-on: ubuntu-20.04 | |
if: "github.event_name == 'pull_request' && !contains(github.event.head_commit.message, '[skip ci]')" | |
steps: | |
- uses: actions/[email protected] | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
fetch-depth: 0 | |
- uses: ./.github/actions/setup-env | |
- name: Run Commit Watch | |
env: | |
COMMIT_WATCH_OUTPUT_DIR: ${{ env.ARTIFACT_DIR }}/ | |
COMMITWATCH_GITHUB_TOKEN: ${{ secrets.TOPHAT_BOT_GH_TOKEN }} | |
CI_REPO_OWNER: ${{ github.repository_owner }} | |
CI_REPO_NAME: ${{ github.event.repository.name }} | |
CI_COMMIT_SHA: ${{ github.event.pull_request.head.sha }} | |
CI_BASE_BRANCH: origin/${{ github.base_ref }} | |
run: yarn dlx commit-watch | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: commit-watch-artifacts | |
path: ${{ env.ARTIFACT_DIR }} | |
tests: | |
name: Lint, Tests, and Build | |
runs-on: ubuntu-20.04 | |
if: "!contains(github.event.head_commit.message, '[skip ci]')" | |
steps: | |
- uses: actions/[email protected] | |
with: | |
fetch-depth: 0 | |
- uses: ./.github/actions/setup-env | |
- name: Linting | |
run: yarn lint:ci | |
- name: Tests | |
run: yarn test:ci | |
- name: Upload Coverage Report | |
run: ./.github/codecov.sh $GITHUB_EVENT_PATH | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: reports-and-build-artifacts | |
path: ${{ env.ARTIFACT_DIR }} | |
publish_preview: | |
name: Publish Preview | |
runs-on: ubuntu-20.04 | |
if: "github.event_name == 'pull_request' && !contains(github.event.head_commit.message, '[skip ci]')" | |
steps: | |
- uses: actions/[email protected] | |
with: | |
fetch-depth: 0 | |
- uses: ./.github/actions/setup-env | |
- name: Run Monodeploy in Dry Run Mode | |
id: run-monodeploy | |
run: | | |
echo "<!-- MONODEPLOY:BELOW -->" > ${{ env.ARTIFACT_DIR }}/CHANGELOG.md | |
yarn monodeploy --dry-run \ | |
--log-level 0 \ | |
--changeset-ignore-patterns '**/*.test.ts' \ | |
--conventional-changelog-config @tophat/conventional-changelog-config \ | |
--git-base-branch origin/${{ github.base_ref }} \ | |
--changelog-filename ${{ env.ARTIFACT_DIR }}/CHANGELOG.md \ | |
--force-write-change-files | |
changelog_body=$(cat ${{ env.ARTIFACT_DIR }}/CHANGELOG.md) | |
changelog_body="${changelog_body//'%'/'%25'}" | |
changelog_body="${changelog_body//$'\n'/'%0A'}" | |
changelog_body="${changelog_body//$'\r'/'%0D'}" | |
echo ::set-output name=changelog::$changelog_body | |
- name: Check for Changelog Comment | |
uses: peter-evans/find-comment@v2 | |
id: found-comment | |
if: github.event_name == 'pull_request' | |
with: | |
token: ${{ secrets.TOPHAT_BOT_GH_TOKEN }} | |
issue-number: ${{ github.event.pull_request.number }} | |
comment-author: 'tophat-opensource-bot' | |
body-includes: <!-- MONODEPLOY_CHANGELOG_PREVIEW --> | |
- name: Post Changelog to PR | |
uses: peter-evans/create-or-update-comment@v2 | |
if: github.event_name == 'pull_request' | |
with: | |
token: ${{ secrets.TOPHAT_BOT_GH_TOKEN }} | |
comment-id: ${{ steps.found-comment.outputs.comment-id }} | |
issue-number: ${{ github.event.pull_request.number }} | |
edit-mode: replace | |
body: | | |
<!-- MONODEPLOY_CHANGELOG_PREVIEW --> | |
# Monodeploy Publish Preview | |
This Pull Request introduces the following changes: | |
${{ steps.run-monodeploy.outputs.changelog }} | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@v2 | |
with: | |
name: build-artifacts | |
path: ${{ env.ARTIFACT_DIR }} |