From 2e0e059e5e92b4004a9c9c1925239506bd6c2531 Mon Sep 17 00:00:00 2001 From: "Kent C. Dodds" Date: Wed, 4 Nov 2020 11:05:29 -0700 Subject: [PATCH 1/4] chore: switch to github actions --- .github/workflows/validate.yml | 65 ++++++++++++++++++++++++++++++++++ .travis.yml | 28 --------------- 2 files changed, 65 insertions(+), 28 deletions(-) create mode 100644 .github/workflows/validate.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml new file mode 100644 index 00000000..43e5a61a --- /dev/null +++ b/.github/workflows/validate.yml @@ -0,0 +1,65 @@ +name: validate +on: [push, pull_request] +jobs: + main: + strategy: + matrix: + os: [ubuntu-latest, windows-latest] + node: [10.14.2, 12, 14, 15] + runs-on: ${{ matrix.os }} + steps: + - name: ⬇️ Checkout repo + uses: actions/checkout@v2 + + - name: ⎔ Setup node + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node }} + + - name: 📥 Download deps + uses: bahmutov/npm-install@v1 + with: + useLockFile: false + + - name: ▶️ Run validate script + run: npm run validate + + - name: ⬆️ Upload coverage report + uses: codecov/codecov-action@v1 + + release: + runs-on: ubuntu-latest + needs: main + steps: + - name: ⬇️ Checkout repo + uses: actions/checkout@v2 + + - name: ⎔ Setup node + uses: actions/setup-node@v1 + with: + node-version: 14 + + - name: 📥 Download deps + uses: bahmutov/npm-install@v1 + with: + useLockFile: false + + - name: 🏗 Run build script + run: npm run build + + - name: 🚀 Release + uses: cycjimmy/semantic-release-action@v2 + with: + semantic_version: 16 + branches: | + [ + '+([0-9])?(.{+([0-9]),x}).x', + 'master', + 'next', + 'next-major', + {name: 'beta', prerelease: true}, + {name: 'alpha', prerelease: true} + ] + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index c9a60b76..00000000 --- a/.travis.yml +++ /dev/null @@ -1,28 +0,0 @@ -language: node_js -cache: npm -notifications: - email: false -node_js: - # technically we support 10.0.0, but some of our tooling doesn't - - 10.14.2 - - 12 - - 14 - - 15 -before_install: - - nvm install-latest-npm -install: - - npm install -script: - - npm run validate - - npx codecov@3 -branches: - only: - - master - - beta - -jobs: - include: - - stage: release - node_js: 14 - script: kcd-scripts travis-release - if: fork = false From 0a4c49639c6960bd220f2f28d05ac681ee48cfca Mon Sep 17 00:00:00 2001 From: "Kent C. Dodds" Date: Wed, 4 Nov 2020 12:00:31 -0700 Subject: [PATCH 2/4] chore: only run release on push and in the right branch --- .github/workflows/validate.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 43e5a61a..e81fa537 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -28,8 +28,11 @@ jobs: uses: codecov/codecov-action@v1 release: - runs-on: ubuntu-latest needs: main + runs-on: ubuntu-latest + if: + ${{ contains('master,beta,next,alpha', github.base_ref) && + github.event_name == 'push' }} steps: - name: ⬇️ Checkout repo uses: actions/checkout@v2 @@ -54,10 +57,10 @@ jobs: branches: | [ '+([0-9])?(.{+([0-9]),x}).x', - 'master', - 'next', - 'next-major', - {name: 'beta', prerelease: true}, + 'master', + 'next', + 'next-major', + {name: 'beta', prerelease: true}, {name: 'alpha', prerelease: true} ] env: From 683c1b3ba9d8fc81ff608871c18f194c38706378 Mon Sep 17 00:00:00 2001 From: "Kent C. Dodds" Date: Wed, 4 Nov 2020 13:31:17 -0700 Subject: [PATCH 3/4] chore: use ref --- .github/workflows/validate.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index e81fa537..1efb752d 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -31,8 +31,9 @@ jobs: needs: main runs-on: ubuntu-latest if: - ${{ contains('master,beta,next,alpha', github.base_ref) && - github.event_name == 'push' }} + ${{ + contains('refs/heads/master,refs/heads/beta,refs/heads/next,refs/heads/alpha', + github.ref) && github.event_name == 'push' }} steps: - name: ⬇️ Checkout repo uses: actions/checkout@v2 From c926105c53156b61d1bef0b48dc8c1a500f9690d Mon Sep 17 00:00:00 2001 From: "Kent C. Dodds" Date: Wed, 4 Nov 2020 13:35:50 -0700 Subject: [PATCH 4/4] docs: update badges --- README.md | 58 ++++++++++++++++++-------------------------- other/MAINTAINING.md | 8 +++--- 2 files changed, 27 insertions(+), 39 deletions(-) diff --git a/README.md b/README.md index 0889b4cb..c5a5128f 100644 --- a/README.md +++ b/README.md @@ -26,8 +26,7 @@ practices.

[![version][version-badge]][package] [![downloads][downloads-badge]][npmtrends] [![MIT License][license-badge]][license] - -[![All Contributors](https://img.shields.io/badge/all_contributors-76-orange.svg?style=flat-square)](#contributors) +[![All Contributors][all-contributors-badge]](#contributors) [![PRs Welcome][prs-badge]][prs] [![Code of Conduct][coc-badge]][coc] [![Discord][discord-badge]][discord] @@ -305,6 +304,7 @@ Thanks goes to these people ([emoji key][emojis]): + This project follows the [all-contributors][all-contributors] specification. @@ -314,49 +314,37 @@ Contributions of any kind welcome! [MIT](LICENSE) + + [npm]: https://www.npmjs.com/ [node]: https://nodejs.org -[build-badge]: - https://img.shields.io/travis/testing-library/dom-testing-library.svg?style=flat-square -[build]: https://travis-ci.org/testing-library/dom-testing-library -[coverage-badge]: - https://img.shields.io/codecov/c/github/testing-library/dom-testing-library.svg?style=flat-square +[build-badge]: https://img.shields.io/github/workflow/status/testing-library/dom-testing-library/validate/master?logo=github&style=flat-square +[build]: https://github.com/testing-library/dom-testing-library/actions?query=workflow%3Avalidate +[coverage-badge]: https://img.shields.io/codecov/c/github/testing-library/dom-testing-library.svg?style=flat-square [coverage]: https://codecov.io/github/testing-library/dom-testing-library -[version-badge]: - https://img.shields.io/npm/v/@testing-library/dom.svg?style=flat-square +[version-badge]: https://img.shields.io/npm/v/@testing-library/dom.svg?style=flat-square [package]: https://www.npmjs.com/package/@testing-library/dom -[downloads-badge]: - https://img.shields.io/npm/dm/@testing-library/dom.svg?style=flat-square +[downloads-badge]: https://img.shields.io/npm/dm/@testing-library/dom.svg?style=flat-square [npmtrends]: http://www.npmtrends.com/@testing-library/dom -[license-badge]: - https://img.shields.io/npm/l/@testing-library/dom.svg?style=flat-square -[license]: - https://github.com/testing-library/dom-testing-library/blob/master/LICENSE -[prs-badge]: - https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square +[license-badge]: https://img.shields.io/npm/l/@testing-library/dom.svg?style=flat-square +[license]: https://github.com/testing-library/dom-testing-library/blob/master/LICENSE +[prs-badge]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square [prs]: http://makeapullrequest.com -[donate-badge]: - https://img.shields.io/badge/$-support-green.svg?style=flat-square -[coc-badge]: - https://img.shields.io/badge/code%20of-conduct-ff69b4.svg?style=flat-square -[coc]: - https://github.com/testing-library/dom-testing-library/blob/master/CODE_OF_CONDUCT.md -[github-watch-badge]: - https://img.shields.io/github/watchers/testing-library/dom-testing-library.svg?style=social +[coc-badge]: https://img.shields.io/badge/code%20of-conduct-ff69b4.svg?style=flat-square +[coc]: https://github.com/testing-library/dom-testing-library/blob/master/CODE_OF_CONDUCT.md +[github-watch-badge]: https://img.shields.io/github/watchers/testing-library/dom-testing-library.svg?style=social [github-watch]: https://github.com/testing-library/dom-testing-library/watchers -[github-star-badge]: - https://img.shields.io/github/stars/testing-library/dom-testing-library.svg?style=social +[github-star-badge]: https://img.shields.io/github/stars/testing-library/dom-testing-library.svg?style=social [github-star]: https://github.com/testing-library/dom-testing-library/stargazers -[twitter]: - https://twitter.com/intent/tweet?text=Check%20out%20dom-testing-library%20by%20%40testing-library%20https%3A%2F%2Fgithub.com%2Ftesting-library%2Fdom-testing-library%20%F0%9F%91%8D -[twitter-badge]: - https://img.shields.io/twitter/url/https/github.com/testing-library/dom-testing-library.svg?style=social +[twitter]: https://twitter.com/intent/tweet?text=Check%20out%20dom-testing-library%20by%20%40testing-library%20https%3A%2F%2Fgithub.com%2Ftesting-library%2Fdom-testing-library%20%F0%9F%91%8D +[twitter-badge]: https://img.shields.io/twitter/url/https/github.com/testing-library/dom-testing-library.svg?style=social [emojis]: https://github.com/all-contributors/all-contributors#emoji-key [all-contributors]: https://github.com/all-contributors/all-contributors -[set-immediate]: - https://developer.mozilla.org/en-US/docs/Web/API/Window/setImmediate +[all-contributors-badge]: https://img.shields.io/github/all-contributors/testing-library/dom-testing-library?color=orange&style=flat-square +[set-immediate]: https://developer.mozilla.org/en-US/docs/Web/API/Window/setImmediate [guiding-principle]: https://twitter.com/kentcdodds/status/977018512689455106 [jest]: https://facebook.github.io/jest -[discord-badge]: - https://img.shields.io/discord/723559267868737556.svg?color=7389D8&labelColor=6A7EC2&logo=discord&logoColor=ffffff&style=flat-square +[discord-badge]: https://img.shields.io/discord/723559267868737556.svg?color=7389D8&labelColor=6A7EC2&logo=discord&logoColor=ffffff&style=flat-square [discord]: https://discord.gg/c6JN9fM + + diff --git a/other/MAINTAINING.md b/other/MAINTAINING.md index 703126da..a9e71e52 100644 --- a/other/MAINTAINING.md +++ b/other/MAINTAINING.md @@ -32,9 +32,9 @@ any more of you than that. As a maintainer, you're fine to make your branches on the main repo or on your own fork. Either way is fine. -When we receive a pull request, a travis build is kicked off automatically (see -the `.travis.yml` for what runs in the travis build). We avoid merging anything -that breaks the travis build. +When we receive a pull request, a github action is kicked off automatically (see +the `.github/workflows/validate.yml` for what runs in the action). We avoid +merging anything that breaks the github action. Please review PRs and focus on the code rather than the individual. You never know when this is someone's first ever PR and we want their experience to be as @@ -49,7 +49,7 @@ to release. See the next section on Releases for more about that. ## Release Our releases are automatic. They happen whenever code lands into `master`. A -travis build gets kicked off and if it's successful, a tool called +github action gets kicked off and if it's successful, a tool called [`semantic-release`](https://github.com/semantic-release/semantic-release) is used to automatically publish a new release to npm as well as a changelog to GitHub. It is only able to determine the version and whether a release is