ci(): properly checkout head for stats #4168
Workflow file for this run
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: '🧪' | |
on: | |
push: | |
branches: [master] | |
paths-ignore: [CHANGELOG.md] | |
pull_request: | |
branches: [master] | |
paths-ignore: [CHANGELOG.md] | |
jobs: | |
prime-build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install dependencies | |
uses: ./.github/actions/cached-install | |
with: | |
node-version: 18.x | |
install-system-deps: true | |
- name: Build fabric.js | |
uses: ./.github/actions/build-fabric-cached | |
node-coverage: | |
needs: [prime-build] | |
runs-on: ubuntu-latest | |
name: Node 18.x ${{ matrix.suite }} tests | |
strategy: | |
fail-fast: false | |
matrix: | |
# For more information see: | |
# https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions | |
# supported Node.js release schedule: https://nodejs.org/en/about/releases/ | |
suite: [unit, visual] | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: ./.github/actions/cached-install | |
with: | |
node-version: 18.x | |
install-system-deps: true | |
- name: Build fabric.js | |
uses: ./.github/actions/build-fabric-cached | |
- name: Run ${{ matrix.suite }} tests with coverage | |
if: matrix.suite == 'unit' | |
run: npm run test:coverage | |
- name: Run ${{ matrix.suite }} tests with coverage | |
if: matrix.suite == 'visual' | |
run: npm run test:visual:coverage | |
- name: Upload test coverage | |
uses: actions/upload-artifact@v3 | |
with: | |
name: coverage-${{ matrix.suite }} | |
path: .nyc_output/*.json | |
browser: | |
needs: [prime-build] | |
name: ${{ matrix.target }} ${{ matrix.suite }} tests | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [18.x] | |
target: [chrome, firefox] | |
suite: [unit, visual] | |
fail-fast: false | |
steps: | |
- name: Unit tests on browser ${{ matrix.target }} | |
uses: actions/checkout@v3 | |
- uses: ./.github/actions/cached-install | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Build fabric.js | |
uses: ./.github/actions/build-fabric-cached | |
- name: Run ${{ matrix.target }} ${{ matrix.suite }} headless test | |
uses: coactions/setup-xvfb@v1 | |
with: | |
run: npm run test -- -c ${{ matrix.target }} -s ${{ matrix.suite }} | |
node: | |
needs: [prime-build] | |
runs-on: ubuntu-latest | |
name: Node ${{ matrix.node-version }} ${{ matrix.suite }} tests | |
strategy: | |
fail-fast: false | |
matrix: | |
# For more information see: | |
# https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions | |
# supported Node.js release schedule: https://nodejs.org/en/about/releases/ | |
node-version: [14.x, 16.x, 20.x] | |
suite: [unit, visual] | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: ./.github/actions/cached-install | |
with: | |
node-version: ${{ matrix.node-version }} | |
install-system-deps: true | |
- name: Build fabric.js | |
uses: ./.github/actions/build-fabric-cached | |
- name: Run ${{ matrix.suite }} tests | |
run: npm run test -- -c node -s ${{ matrix.suite }} | |
jest: | |
name: Jest tests | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: ./.github/actions/cached-install | |
with: | |
node-version: 18.x | |
install-system-deps: true | |
- name: Run Jest unit test | |
run: npm run test:jest:coverage | |
- name: Upload test coverage | |
uses: actions/upload-artifact@v3 | |
with: | |
name: coverage-jest | |
path: .nyc_output/*.json | |
coverage: | |
needs: [node-coverage] | |
name: Coverage reporting | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: ./.github/actions/cached-install | |
with: | |
node-version: 18.x | |
install-system-deps: false | |
- uses: actions/download-artifact@v3 | |
with: | |
name: coverage-unit | |
path: .nyc_output | |
- uses: actions/download-artifact@v3 | |
with: | |
name: coverage-visual | |
path: .nyc_output | |
- run: ls -l .nyc_output | |
- run: npm run coverage:report | |
- uses: ShaMan123/lcov-reporter-action@v1.1.1 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
delete-old-comments: true | |
update-comment: true |