diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index cebc11f7..00000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,124 +0,0 @@ -version: 2.1 - -aliases: - - &filter-only-main - branches: - only: - - main - - &filter-ignore-main - branches: - ignore: - - main - -defaults: &defaults - docker: - - image: cimg/node:current - working_directory: ~/react-native-testing-library - -orbs: - codecov: codecov/codecov@3.2.2 - -jobs: - install-dependencies: - <<: *defaults - steps: - - checkout - - attach_workspace: - at: ~/react-native-testing-library - - restore_cache: - keys: - - dependencies-{{ checksum "yarn.lock" }} - - run: yarn install --frozen-lockfile --no-progress --non-interactive --cache-folder ~/.cache/yarn - - save_cache: - key: dependencies-{{ checksum "yarn.lock" }} - paths: - - ~/.cache/yarn - - persist_to_workspace: - root: . - paths: - - . - lint-and-typescript: - <<: *defaults - steps: - - attach_workspace: - at: ~/react-native-testing-library - - run: | - yarn lint - yarn typecheck - flow: - <<: *defaults - steps: - - attach_workspace: - at: ~/react-native-testing-library - - run: | - yarn flow - tests: - <<: *defaults - steps: - - attach_workspace: - at: ~/react-native-testing-library - - run: yarn test:ci - - store_artifacts: - path: coverage - destination: coverage - - codecov/upload - test-react-17: - <<: *defaults - steps: - - attach_workspace: - at: ~/react-native-testing-library - - run: | - yarn test:ci:react:17 - test-website: - <<: *defaults - steps: - - attach_workspace: - at: ~/react-native-testing-library - - run: | - cd website && yarn install && yarn build - upload-code-coverage: - <<: *defaults - steps: - - codecov/upload: - file: coverage/coverage-final.json - deploy-website: - <<: *defaults - steps: - - checkout - - run: - name: Deploying to GitHub Pages - command: | - git config --global user.email "thymikee@users.noreply.github.com" - git config --global user.name "Michał Pierzchała" - echo "machine github.com login thymikee password $GITHUB_TOKEN" > ~/.netrc - cd website && yarn install && GIT_USER=thymikee yarn deploy - -workflows: - version: 2 - build-and-test: - jobs: - - install-dependencies - - lint-and-typescript: - requires: - - install-dependencies - - flow: - requires: - - install-dependencies - - tests: - requires: - - install-dependencies - - test-react-17: - requires: - - install-dependencies - - test-website: - requires: - - install-dependencies - # docusuarus build is running when deploying website as well - filters: *filter-ignore-main - - upload-code-coverage: - requires: - - tests - - deploy-website: - requires: - - install-dependencies - filters: *filter-only-main diff --git a/.github/actions/setup-node-deps/action.yml b/.github/actions/setup-node-deps/action.yml index 5b4ba66d..b0658beb 100644 --- a/.github/actions/setup-node-deps/action.yml +++ b/.github/actions/setup-node-deps/action.yml @@ -7,7 +7,7 @@ runs: - name: Setup Node.js uses: actions/setup-node@v3 with: - node-version: '16' + node-version: 18 - name: Cache deps id: yarn-cache diff --git a/.github/workflows/deploy-website.yml b/.github/workflows/deploy-website.yml new file mode 100644 index 00000000..9726abb4 --- /dev/null +++ b/.github/workflows/deploy-website.yml @@ -0,0 +1,37 @@ +name: Deploy Website to GitHub Pages + +on: + push: + branches: + - main + - 'chore/gh-actions-docs' + +jobs: + deploy: + name: Deploy to GitHub Pages + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Setup Node.js and deps + uses: ./.github/actions/setup-node-deps + + - name: Build website + run: yarn build + + # Popular action to deploy to GitHub Pages: + # Docs: https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-docusaurus + - name: Deploy to GitHub Pages + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + # Build output to publish to the `gh-pages` branch: + publish_dir: ./build + # The following lines assign commit authorship to the official + # GH-Actions bot for deploys to `gh-pages` branch: + # https://github.com/actions/checkout/issues/13#issuecomment-724415212 + # The GH actions bot is used by default if you didn't specify the two fields. + # You can swap them out with your own user credentials. + user_name: github-actions[bot] + user_email: 41898282+github-actions[bot]@users.noreply.github.com diff --git a/website/docs/MigrationV2.md b/website/docs/MigrationV2.md index c5a113fc..8ec78f51 100644 --- a/website/docs/MigrationV2.md +++ b/website/docs/MigrationV2.md @@ -124,3 +124,5 @@ function flushMicrotasksQueue() { return new Promise((resolve) => setImmediate(resolve)); } ``` + +1, 2, 3 MIC CHECK diff --git a/website/docusaurus.config.js b/website/docusaurus.config.js index b997039c..db189f76 100644 --- a/website/docusaurus.config.js +++ b/website/docusaurus.config.js @@ -10,6 +10,7 @@ const siteConfig = { projectName: 'react-native-testing-library', organizationName: 'callstack', favicon: 'img/owl.png', + trailingSlash: false, themeConfig: { navbar: { diff --git a/website/static/.nojekyll b/website/static/.nojekyll new file mode 100644 index 00000000..e69de29b