chore(deps): further upgrade project tooling #1492
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: CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- run: echo "commits_count_incr=$(($COUNT+1))" >> $GITHUB_ENV | |
if: ${{ github.event_name == 'pull_request' }} | |
env: | |
COUNT: ${{ github.event.pull_request.commits }} | |
- uses: actions/checkout@v4 | |
if: ${{ github.event_name == 'pull_request' }} | |
with: | |
fetch-depth: ${{ env.commits_count_incr }} | |
- uses: actions/checkout@v4 | |
if: ${{ github.event_name != 'pull_request' }} | |
- uses: actions/setup-node@v4 | |
with: | |
node-version-file: ".nvmrc" | |
- id: node-cache | |
uses: actions/cache@v3 | |
with: | |
path: node_modules | |
key: ${{ runner.os }}-node-${{ hashFiles('**/.nvmrc') }}-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node- | |
- if: steps.node-cache.outputs.cache-hit != 'true' | |
run: npm ci | |
# Test Git hooks in CI, to make sure script upgrades do not break them. | |
- run: npm run prepare | |
# Test commit message validation in CI. | |
- run: git log -1 --pretty=%B >> latest.log && ./.git/hooks/commit-msg latest.log | |
- run: DRAFTJS_VERSION=0.11 npm run test:ci | |
- run: DRAFTJS_VERSION=0.10 npm run test | |
- run: npx commitlint --from HEAD~${{ github.event.pull_request.commits }} --to HEAD | |
if: ${{ github.event_name == 'pull_request' }} | |
- run: npm run report:package | |
- run: mv coverage/lcov-report build || true | |
- run: cat ./coverage/lcov.info | npx coveralls || true | |
- uses: actions/configure-pages@v4 | |
- uses: actions/upload-pages-artifact@v3 | |
with: | |
path: build | |
- run: npx semantic-release | |
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
GIT_AUTHOR_NAME: ${{ secrets.GIT_AUTHOR_NAME }} | |
GIT_AUTHOR_EMAIL: ${{ secrets.GIT_AUTHOR_EMAIL }} | |
deploy: | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
permissions: | |
pages: write | |
id-token: write | |
runs-on: ubuntu-latest | |
needs: test | |
if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
steps: | |
- uses: actions/deploy-pages@v4 |