This repository has been archived by the owner on Mar 2, 2024. It is now read-only.
update node version #151
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: | |
workflow_dispatch: | |
jobs: | |
build: | |
name: Build, lint, and test on Node ${{ matrix.node }} and ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
node: ['14.x', '16.x', '18.x'] | |
os: [ubuntu-latest] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- uses: pnpm/[email protected] | |
with: | |
version: 7.0.0-rc.5 | |
- name: Use Node ${{ matrix.node }} | |
uses: actions/setup-node@v2 | |
with: | |
node-version: ${{ matrix.node }} | |
cache: 'pnpm' | |
- name: Install dependencies | |
run: pnpm install --frozen-lockfile | |
- name: Build | |
working-directory: packages/tg-sticker-creator | |
run: pnpm build | |
- name: Test | |
working-directory: packages/tg-sticker-creator | |
run: | | |
coverage_percentage=$(pnpm test:ci | awk '$1 == "Statements" {print $3}') | |
curl "https://raster.shields.io/static/v1?label=coverage&message=$coverage_percentage&color=informational" > coverage/badge.png | |
env: | |
JEST_HTML_REPORTERS_PUBLIC_PATH: coverage | |
JEST_HTML_REPORTERS_FILE_NAME: jest-report.html | |
JEST_HTML_REPORTERS_HIDE_ICON: true | |
JEST_HTML_REPORTERS_PAGE_TITLE: TG Sticker Creator Test Report | |
- name: Archive coverage | |
uses: actions/upload-artifact@v2 | |
# if: ${{ github.ref == 'refs/heads/master' }} | |
with: | |
name: code-coverage-report | |
path: packages/tg-sticker-creator/coverage | |
docs: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- uses: pnpm/[email protected] | |
with: | |
version: 7.0.0-rc.5 | |
- name: Use Node | |
uses: actions/setup-node@v2 | |
with: | |
node-version: 14.x | |
cache: 'pnpm' | |
- name: Install dependencies | |
run: pnpm install --frozen-lockfile | |
- name: Build | |
working-directory: packages/tg-sticker-creator | |
run: pnpm docs:build | |
- uses: actions/download-artifact@v2 | |
with: | |
name: code-coverage-report | |
path: packages/tg-sticker-creator/coverage | |
- | |
working-directory: packages/tg-sticker-creator | |
run: | | |
mkdir pages | |
cp -r docs pages | |
cp -r coverage pages/coverage | |
- name: GitHub Pages action | |
uses: peaceiris/[email protected] | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: packages/tg-sticker-creator/pages |