Skip to content

Commit 7e6e75d

Browse files
committed
chore: switch to github actions
1 parent 007b0b7 commit 7e6e75d

File tree

4 files changed

+101
-48
lines changed

4 files changed

+101
-48
lines changed

.travis.yml

-38
This file was deleted.

README.md

+9-6
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,12 @@ practices.</p>
2626
<!-- prettier-ignore-start -->
2727
[![Build Status][build-badge]][build]
2828
[![Code Coverage][coverage-badge]][coverage]
29-
[![version][version-badge]][package] [![downloads][downloads-badge]][npmtrends]
29+
[![version][version-badge]][package]
30+
[![downloads][downloads-badge]][npmtrends]
3031
[![MIT License][license-badge]][license]
31-
32-
[![All Contributors](https://img.shields.io/badge/all_contributors-102-orange.svg?style=flat-square)](#contributors)
33-
[![PRs Welcome][prs-badge]][prs] [![Code of Conduct][coc-badge]][coc]
32+
[![All Contributors][all-contributors-badge]](#contributors)
33+
[![PRs Welcome][prs-badge]][prs]
34+
[![Code of Conduct][coc-badge]][coc]
3435
[![Discord][discord-badge]][discord]
3536

3637
[![Watch on GitHub][github-watch-badge]][github-watch]
@@ -608,6 +609,7 @@ Thanks goes to these people ([emoji key][emojis]):
608609
609610
<!-- markdownlint-enable -->
610611
<!-- prettier-ignore-end -->
612+
611613
<!-- ALL-CONTRIBUTORS-LIST:END -->
612614
613615
This project follows the [all-contributors][all-contributors] specification.
@@ -622,8 +624,8 @@ Contributions of any kind welcome!
622624
[npm]: https://www.npmjs.com/
623625
[yarn]: https://classic.yarnpkg.com
624626
[node]: https://nodejs.org
625-
[build-badge]: https://img.shields.io/travis/testing-library/react-testing-library.svg?style=flat-square
626-
[build]: https://travis-ci.org/testing-library/react-testing-library
627+
[build-badge]: https://img.shields.io/github/workflow/status/testing-library/react-testing-library/validate?logo=github&style=flat-square
628+
[build]: https://github.com/testing-library/react-testing-library/actions?query=workflow%3Avalidate
627629
[coverage-badge]: https://img.shields.io/codecov/c/github/testing-library/react-testing-library.svg?style=flat-square
628630
[coverage]: https://codecov.io/github/testing-library/react-testing-library
629631
[version-badge]: https://img.shields.io/npm/v/@testing-library/react.svg?style=flat-square
@@ -644,6 +646,7 @@ Contributions of any kind welcome!
644646
[twitter-badge]: https://img.shields.io/twitter/url/https/github.com/testing-library/react-testing-library.svg?style=social
645647
[emojis]: https://github.com/all-contributors/all-contributors#emoji-key
646648
[all-contributors]: https://github.com/all-contributors/all-contributors
649+
[all-contributors-badge]: https://img.shields.io/github/all-contributors/testing-library/react-testing-library?color=orange&style=flat-square
647650
[guiding-principle]: https://twitter.com/kentcdodds/status/977018512689455106
648651
[bugs]: https://github.com/testing-library/react-testing-library/issues?q=is%3Aissue+is%3Aopen+label%3Abug+sort%3Acreated-desc
649652
[requests]: https://github.com/testing-library/react-testing-library/issues?q=is%3Aissue+sort%3Areactions-%2B1-desc+label%3Aenhancement+is%3Aopen

github/workflows/validate.yml

+88
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
name: validate
2+
on:
3+
push:
4+
branches:
5+
[
6+
'+([0-9])?(.{+([0-9]),x}).x',
7+
'master',
8+
'next',
9+
'next-major',
10+
'beta',
11+
'alpha',
12+
'!all-contributors/**',
13+
]
14+
pull_request:
15+
branches-ignore: ['all-contributors/**']
16+
jobs:
17+
main:
18+
continue-on-error: ${{ matrix.react != 'latest' }}
19+
strategy:
20+
matrix:
21+
node: [10.13, 12, 14, 15]
22+
react: [latest, next, experimental]
23+
runs-on: ubuntu-latest
24+
steps:
25+
- name: ⬇️ Checkout repo
26+
uses: actions/checkout@v2
27+
28+
- name: ⎔ Setup node
29+
uses: actions/setup-node@v1
30+
with:
31+
node-version: ${{ matrix.node }}
32+
33+
- name: 📥 Download deps
34+
uses: bahmutov/npm-install@v1
35+
with:
36+
useLockFile: false
37+
38+
# as requested by the React team :)
39+
# https://reactjs.org/blog/2019/10/22/react-release-channels.html#using-the-next-channel-for-integration-testing
40+
- name: ⚛️ Setup react
41+
run: npm install react@${{matrix.react}} react-dom@${{matrix.react}}
42+
43+
- name: ▶️ Run validate script
44+
run: npm run validate
45+
46+
- name: ⬆️ Upload coverage report
47+
uses: codecov/codecov-action@v1
48+
49+
release:
50+
needs: main
51+
runs-on: ubuntu-latest
52+
if:
53+
${{ github.repository == 'testing-library/react-testing-library' &&
54+
contains('refs/heads/master,refs/heads/beta,refs/heads/next,refs/heads/alpha',
55+
github.ref) && github.event_name == 'push' }}
56+
steps:
57+
- name: ⬇️ Checkout repo
58+
uses: actions/checkout@v2
59+
60+
- name: ⎔ Setup node
61+
uses: actions/setup-node@v1
62+
with:
63+
node-version: 14
64+
65+
- name: 📥 Download deps
66+
uses: bahmutov/npm-install@v1
67+
with:
68+
useLockFile: false
69+
70+
- name: 🏗 Run build script
71+
run: npm run build
72+
73+
- name: 🚀 Release
74+
uses: cycjimmy/semantic-release-action@v2
75+
with:
76+
semantic_version: 17
77+
branches: |
78+
[
79+
'+([0-9])?(.{+([0-9]),x}).x',
80+
'master',
81+
'next',
82+
'next-major',
83+
{name: 'beta', prerelease: true},
84+
{name: 'alpha', prerelease: true}
85+
]
86+
env:
87+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
88+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

other/MAINTAINING.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ any more of you than that.
3232
As a maintainer, you're fine to make your branches on the main repo or on your
3333
own fork. Either way is fine.
3434

35-
When we receive a pull request, a travis build is kicked off automatically (see
36-
the `.travis.yml` for what runs in the travis build). We avoid merging anything
37-
that breaks the travis build.
35+
When we receive a pull request, a github action is kicked off automatically (see
36+
the `.github/workflows/validate.yml` for what runs in the action). We avoid
37+
merging anything that breaks the validate action.
3838

3939
Please review PRs and focus on the code rather than the individual. You never
4040
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.
4949
## Release
5050

5151
Our releases are automatic. They happen whenever code lands into `master`. A
52-
travis build gets kicked off and if it's successful, a tool called
52+
github action gets kicked off and if it's successful, a tool called
5353
[`semantic-release`](https://github.com/semantic-release/semantic-release) is
5454
used to automatically publish a new release to npm as well as a changelog to
5555
GitHub. It is only able to determine the version and whether a release is

0 commit comments

Comments
 (0)