chore(deps): update typescript-eslint monorepo to v8 (major) #220
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: 'Test' | |
on: | |
push: | |
branches: | |
- main | |
paths-ignore: | |
- '*.md' | |
pull_request: | |
paths-ignore: | |
- '*.md' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
jobs: | |
test: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: | |
- 'ubuntu-22.04' | |
- 'ubuntu-20.04' | |
- 'ubuntu-latest' | |
- 'macos-latest' | |
- 'windows-latest' | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Dump GitHub context | |
env: | |
GITHUB_CONTEXT: ${{ toJson(github) }} | |
run: echo "${GITHUB_CONTEXT}" | |
- name: Read .nvmrc | |
run: echo "::set-output name=NVMRC::$(cat .nvmrc)" | |
id: nvm | |
- name: Setup Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '${{ steps.nvm.outputs.NVMRC }}' | |
- name: Dump version | |
run: | | |
node -v | |
npm --version | |
yarn -v | |
git --version | |
- run: yarn | |
- name: npm audit | |
if: startsWith(matrix.os, 'ubuntu-22.04') | |
run: | | |
npm audit > ./audit.log || true | |
if ! [ "$(cat ./audit.log | wc -l)" = 1 ]; then | |
echo "::warning::$(cat ./audit.log)" | |
fi | |
rm ./audit.log | |
- name: Run prettier | |
if: startsWith(matrix.os, 'ubuntu-22.04') | |
run: npm run format:check | |
- name: Run eslint | |
if: startsWith(matrix.os, 'ubuntu-22.04') | |
run: npm run lint | |
- run: npm test | |
- name: Upload test coverage as artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: coverage-${{ matrix.os }} | |
path: coverage | |
- uses: codecov/codecov-action@v3 | |
- name: Run ncc | |
run: npm run build | |
- name: Remove lint-staged husky | |
if: ${{ github.ref == 'refs/heads/main' }} | |
run: | | |
npm uninstall lint-staged husky | |
git checkout yarn.lock package.json | |
- name: Setup mdBook | |
if: ${{ github.ref == 'refs/heads/main' }} | |
uses: peaceiris/actions-mdbook@v1.2.0 | |
with: | |
mdbook-version: '0.4.5' | |
- name: Build site | |
if: ${{ github.ref == 'refs/heads/main' }} | |
working-directory: ./test_projects/mdbook | |
run: mdbook build | |
- name: Deploy | |
if: | | |
startsWith(matrix.os, 'ubuntu-latest') && | |
github.ref == 'refs/heads/main' && github.event.repository.fork == false | |
uses: ./ | |
with: | |
# deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }} | |
external_repository: upcwangying/gitee-pages | |
personal_token: ${{ secrets.GITEE_TOKEN }} | |
# publish_branch: gh-pages | |
publish_dir: ./test_projects/mdbook/book | |
# external_repository: '' | |
allow_empty_commit: true | |
# keep_files: true | |
# force_orphan: true | |
user_name: 'upcwangying' | |
user_email: 'github-actions[bot]@users.noreply.github.com' | |
# commit_message: ${{ github.event.head_commit.message }} | |
cname: 'gitee-pages.kimmy.me' | |
- name: Deploy | |
if: | | |
startsWith(matrix.os, 'macos') && | |
github.ref == 'refs/heads/main' && github.event.repository.fork == false | |
uses: ./ | |
with: | |
# deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }} | |
external_repository: upcwangying/gitee-pages | |
personal_token: ${{ secrets.GITEE_TOKEN }} | |
# personal_token: ${{ secrets.PERSONAL_TOKEN }} | |
publish_branch: gh-pages-macos | |
publish_dir: ./test_projects/mdbook/book | |
# external_repository: '' | |
allow_empty_commit: true | |
# keep_files: true | |
# force_orphan: true | |
user_name: 'upcwangying' | |
user_email: 'github-actions[bot]@users.noreply.github.com' | |
# commit_message: ${{ github.event.head_commit.message }} | |
- name: Deploy | |
if: | | |
startsWith(matrix.os, 'windows') && | |
github.ref == 'refs/heads/main' && github.event.repository.fork == false | |
uses: ./ | |
with: | |
# deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }} | |
external_repository: upcwangying/gitee-pages | |
personal_token: ${{ secrets.GITEE_TOKEN }} | |
# personal_token: ${{ secrets.PERSONAL_TOKEN }} | |
publish_branch: gh-pages-windows | |
publish_dir: ./test_projects/mdbook/book | |
# external_repository: '' | |
allow_empty_commit: true | |
# keep_files: true | |
# force_orphan: true | |
user_name: 'upcwangying' | |
user_email: 'github-actions[bot]@users.noreply.github.com' | |
# commit_message: ${{ github.event.head_commit.message }} | |
- name: Deploy | |
if: | | |
startsWith(matrix.os, 'ubuntu-20.04') && | |
github.ref == 'refs/heads/main' && github.event.repository.fork == false | |
uses: ./ | |
with: | |
# deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }} | |
external_repository: upcwangying/gitee-pages | |
personal_token: ${{ secrets.GITEE_TOKEN }} | |
publish_branch: gh-pages-ubuntu-20.04 | |
publish_dir: ./test_projects/mdbook/book | |
# external_repository: '' | |
allow_empty_commit: true | |
# keep_files: true | |
# force_orphan: true | |
user_name: 'upcwangying' | |
user_email: 'github-actions[bot]@users.noreply.github.com' | |
# commit_message: ${{ github.event.head_commit.message }} | |
- name: Deploy | |
if: | | |
startsWith(matrix.os, 'ubuntu-22.04') && | |
github.ref == 'refs/heads/main' && github.event.repository.fork == false | |
uses: ./ | |
with: | |
# deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }} | |
external_repository: upcwangying/gitee-pages | |
personal_token: ${{ secrets.GITEE_TOKEN }} | |
publish_branch: gh-pages-ubuntu-22.04 | |
publish_dir: ./test_projects/mdbook/book | |
# external_repository: '' | |
allow_empty_commit: true | |
# keep_files: true | |
# force_orphan: true | |
user_name: 'upcwangying' | |
user_email: 'github-actions[bot]@users.noreply.github.com' | |
# commit_message: ${{ github.event.head_commit.message }} |