Files
test-repo/.github/workflows/dev-test.yml
T
fisker Cheung a85f38f096 Merge branch 'main' into next
# Conflicts:
#	.github/workflows/dev-test.yml
#	jest.config.mjs
#	package.json
#	scripts/vendors/vendor-meta.json
#	scripts/vendors/vendors.mjs
#	src/cli/format.js
#	src/cli/options/create-minimist-options.js
#	src/cli/options/parse-cli-arguments.js
#	src/cli/usage.js
#	src/cli/utils.js
#	src/common/create-ignorer.js
#	src/common/load-plugins.js
#	src/config/resolve-config.js
#	src/index.js
#	src/language-css/utils/css-units.evaluate.js
#	src/language-html/ast.js
#	src/language-html/print-preprocess.js
#	src/language-html/utils/index.js
#	src/main/multiparser.js
#	tests/format/markdown/auto-link/jsfmt.spec.js
#	tests/integration/__tests__/__snapshots__/config-resolution.js.snap
#	tests/integration/__tests__/__snapshots__/with-config-precedence.js.snap
#	tests/integration/__tests__/file-info.js
#	yarn.lock
2022-04-25 14:28:27 +08:00

95 lines
2.6 KiB
YAML

name: Dev
on:
push:
branches:
- main
- patch-release
- next
pull_request:
jobs:
test:
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
os:
- "ubuntu-latest"
- "macos-latest"
- "windows-latest"
node:
- "18"
- "16"
- "14"
include:
# only enable coverage on the fastest job
- os: "ubuntu-latest"
node: "18"
ENABLE_CODE_COVERAGE: true
FULL_TEST: true
CHECK_TEST_PARSERS: true
exclude:
- os: "macos-latest"
node: "16"
- os: "windows-latest"
node: "16"
env:
ENABLE_CODE_COVERAGE: ${{ matrix.ENABLE_CODE_COVERAGE }}
FULL_TEST: ${{ matrix.FULL_TEST }}
CHECK_TEST_PARSERS: ${{ matrix.CHECK_TEST_PARSERS }}
name: Node.js ${{ matrix.node }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: "yarn"
- name: Install Dependencies
run: yarn install --frozen-lockfile
# - name: Run Integration Tests (macOS)
# if: ${{ matrix.os == 'macos-latest' }}
# run: yarn test:integration --maxWorkers=4
# - name: Run Integration Tests (Linux and Windows)
# if: ${{ matrix.os != 'macos-latest' }}
# run: yarn test:integration --maxWorkers=2
# - name: Upload Coverage
# uses: codecov/codecov-action@v2.1.0
# if: ${{ matrix.ENABLE_CODE_COVERAGE }}
# with:
# fail_ci_if_error: true
- name: Run Format Tests (macOS)
if: ${{ matrix.os == 'macos-latest' }}
run: yarn test:format --maxWorkers=4
- name: Run Format Tests (Linux and Windows)
if: ${{ matrix.os != 'macos-latest' }}
run: yarn c8 yarn test:format --maxWorkers=2
- name: Upload Coverage
uses: codecov/codecov-action@v3.1.0
if: ${{ matrix.ENABLE_CODE_COVERAGE }}
with:
fail_ci_if_error: true
# # #8073 test
# - name: Run Tests (PRETTIER_FALLBACK_RESOLVE)
# run: yarn test "tests/integration/__tests__/(config|plugin)"
# env:
# PRETTIER_FALLBACK_RESOLVE: true
# - name: Upload Coverage (PRETTIER_FALLBACK_RESOLVE)
# uses: codecov/codecov-action@v3.1.0
# if: ${{ matrix.ENABLE_CODE_COVERAGE }}
# with:
# fail_ci_if_error: true