diff --git a/.eslintrc.yml b/.eslintrc.yml index 92eae8b94..92358a0dd 100644 --- a/.eslintrc.yml +++ b/.eslintrc.yml @@ -43,15 +43,13 @@ settings: version: 16.3.2 overrides: - - files: '*.md' - extends: plugin:mdx/recommended - - files: '*.mdx' extends: - plugin:mdx/recommended - plugin:mdx/overrides rules: import/no-extraneous-dependencies: 0 + prettier/prettier: 0 - files: - '**/test/**/*.js' diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5f99dd4fc..9736523b5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,46 +7,40 @@ jobs: name: Build and Test on ${{ matrix.os }} with Node.js ${{ matrix.node }} strategy: matrix: - os: [ubuntu-latest, windows-latest] - node: [10, 14] + os: + - ubuntu-latest + - windows-latest + node: + - 10 + - 14 runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v2 - - uses: actions/setup-node@v2-beta with: node-version: ${{ matrix.node }} - - - name: Setup yarn - if: matrix.os != 'windows-latest' + - name: Get yarn run: | curl -o- -L https://yarnpkg.com/install.sh | bash export PATH="$HOME/.yarn/bin:$PATH" - - - name: Get yarn cache directory path + - name: Get yarn cache id: yarn-cache-dir-path run: echo "::set-output name=dir::$(yarn cache dir)" - - - uses: actions/cache@v2 + - name: Set yarn cache + uses: actions/cache@v2 id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) with: path: ${{ steps.yarn-cache-dir-path.outputs.dir }} key: ${{ runner.os }}-${{ matrix.node }}-yarn-${{ hashFiles('**/yarn.lock') }} restore-keys: | ${{ runner.os }}-${{ matrix.node }}-yarn- - - - name: Install Dependencies + - name: Install run: yarn --frozen-lockfile env: CI: 'true' - - - name: Build - if: matrix.os != 'windows-latest' - run: yarn build - - name: Test run: yarn test - + # To do: macos isn’t used anymore - name: Publish CI tag to npm if: matrix.node == 12 && matrix.os == 'macOS-latest' && github.event_name == 'push' && github.ref == 'refs/heads/master' run: | diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml deleted file mode 100644 index 864b13162..000000000 --- a/.github/workflows/lint.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: CI - -on: [push, pull_request] - -jobs: - default: - name: Lint JS and MDX files - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - - uses: actions/setup-node@v2-beta - with: - node-version: 14 - - - name: Setup yarn - run: | - curl -o- -L https://yarnpkg.com/install.sh | bash - export PATH="$HOME/.yarn/bin:$PATH" - - - name: Install Dependencies - run: yarn --frozen-lockfile - env: - CI: 'true' - - - name: Lint - run: yarn lint diff --git a/.github/workflows/types.yml b/.github/workflows/types.yml deleted file mode 100644 index 728041bc0..000000000 --- a/.github/workflows/types.yml +++ /dev/null @@ -1,42 +0,0 @@ -name: CI - -on: [push, pull_request] - -jobs: - default: - name: Test MDX types - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - - uses: actions/setup-node@v2-beta - with: - node-version: 14 - - - name: Setup yarn - run: | - curl -o- -L https://yarnpkg.com/install.sh | bash - export PATH="$HOME/.yarn/bin:$PATH" - - - name: Get yarn cache directory path - id: yarn-cache-dir-path - run: echo "::set-output name=dir::$(yarn cache dir)" - - - uses: actions/cache@v2 - id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) - with: - path: ${{ steps.yarn-cache-dir-path.outputs.dir }} - key: ubuntu-latest-14-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ubuntu-latest-14-yarn- - - - name: Install Dependencies - run: yarn --frozen-lockfile - env: - CI: 'true' - - - name: Build - run: yarn build - - - name: Test types - run: yarn test-types diff --git a/package.json b/package.json index 4dd0fee3d..0a50e797f 100644 --- a/package.json +++ b/package.json @@ -22,16 +22,15 @@ "docs-build": "gatsby build", "docs-deploy": "now && now alias $(pbpaste) mdxjs.com && now alias $(pbpaste) www.mdxjs.com", "format": "yarn lint --fix", - "lint": "eslint . --cache --ext js,jsx,md,mdx -f friendly", + "lint": "eslint . --cache --ext js,jsx,mdx -f friendly", "now-build": "yarn build && yarn docs-build", "postinstall": "yarn-deduplicate || exit 0", "prepublishOnly": "yarn build", - "pretest": "yarn build", "publish": "lerna publish --force-publish=\"*\"", "publish-ci": "lerna publish -y --canary --preid ci --pre-dist-tag ci", "publish-next": "lerna publish --force-publish=\"*\" --pre-dist-tag next --preid next", "test-only": "lerna run test --no-private", - "test": "lerna run test --no-private" + "test": "yarn build && yarn lint && yarn test-only" }, "dependencies": {}, "devDependencies": {