Skip to content

Commit 2927c95

Browse files
MatanBobinickserv
andauthored
ci: Add validate workflow instead of travis (#311)
* ci: add validate workflow based on yo kcd-oss * chore: remove travis file * chore: force enabling colors for validate script * chore: use master branch * chore: update Code of Conduct email address Co-authored-by: Nick McCurdy <nick@nickmccurdy.com>
1 parent 8298015 commit 2927c95

File tree

6 files changed

+214
-94
lines changed

6 files changed

+214
-94
lines changed

.github/workflows/validate.yml

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

.travis.yml

Lines changed: 0 additions & 24 deletions
This file was deleted.

CONTRIBUTING.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ series [How to Contribute to an Open Source Project on GitHub][egghead]
77

88
## Project setup
99

10-
1. Fork and clone the repo
11-
2. Run `npm run setup -s` to install dependencies and run validation
12-
3. Create a branch for your PR with `git checkout -b pr/your-branch-name`
10+
1. Fork and clone the repo
11+
2. Run `npm run setup -s` to install dependencies and run validation
12+
3. Create a branch for your PR with `git checkout -b pr/your-branch-name`
1313

1414
> Tip: Keep your `master` branch pointing at the original repository and make
1515
> pull requests from branches on your fork. To do this, run:
@@ -39,7 +39,8 @@ Please checkout the [the open issues][issues]
3939
Also, please watch the repo and respond to questions/bug reports/feature
4040
requests! Thanks!
4141
42-
[egghead]:
43-
https://egghead.io/series/how-to-contribute-to-an-open-source-project-on-github
42+
<!-- prettier-ignore-start -->
43+
[egghead]: https://egghead.io/series/how-to-contribute-to-an-open-source-project-on-github
4444
[all-contributors]: https://github.com/all-contributors/all-contributors
4545
[issues]: https://github.com/testing-library/jest-dom/issues
46+
<!-- prettier-ignore-end -->

README.md

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
---
1818

19+
<!-- prettier-ignore-start -->
1920
[![Build Status][build-badge]][build]
2021
[![Code Coverage][coverage-badge]][coverage]
2122
[![version][version-badge]][package] [![downloads][downloads-badge]][npmtrends]
@@ -28,6 +29,7 @@
2829
[![Watch on GitHub][github-watch-badge]][github-watch]
2930
[![Star on GitHub][github-star-badge]][github-star]
3031
[![Tweet][twitter-badge]][twitter]
32+
<!-- prettier-ignore-end -->
3133

3234
## The problem
3335

@@ -158,7 +160,9 @@ expect(getByTestId('input')).toBeDisabled()
158160
expect(getByText('link')).not.toBeDisabled()
159161
```
160162

161-
> This custom matcher does not take into account the presence or absence of the `aria-disabled` attribute. For more on why this is the case, check [#144](https://github.com/testing-library/jest-dom/issues/144).
163+
> This custom matcher does not take into account the presence or absence of the
164+
> `aria-disabled` attribute. For more on why this is the case, check
165+
> [#144](https://github.com/testing-library/jest-dom/issues/144).
162166
163167
<hr />
164168

@@ -174,7 +178,9 @@ perspective.
174178
It works like `not.toBeDisabled()`. Use this matcher to avoid double negation in
175179
your tests.
176180

177-
> This custom matcher does not take into account the presence or absence of the `aria-disabled` attribute. For more on why this is the case, check [#144](https://github.com/testing-library/jest-dom/issues/144).
181+
> This custom matcher does not take into account the presence or absence of the
182+
> `aria-disabled` attribute. For more on why this is the case, check
183+
> [#144](https://github.com/testing-library/jest-dom/issues/144).
178184
179185
<hr />
180186

@@ -243,9 +249,7 @@ This allows you to assert whether an element is present in the document or not.
243249
expect(
244250
getByTestId(document.documentElement, 'html-element'),
245251
).toBeInTheDocument()
246-
expect(
247-
getByTestId(document.documentElement, 'svg-element'),
248-
).toBeInTheDocument()
252+
expect(getByTestId(document.documentElement, 'svg-element')).toBeInTheDocument()
249253
expect(
250254
queryByTestId(document.documentElement, 'does-not-exist'),
251255
).not.toBeInTheDocument()
@@ -1160,6 +1164,7 @@ Thanks goes to these people ([emoji key][emojis]):
11601164

11611165
<!-- markdownlint-enable -->
11621166
<!-- prettier-ignore-end -->
1167+
11631168
<!-- ALL-CONTRIBUTORS-LIST:END -->
11641169

11651170
This project follows the [all-contributors][all-contributors] specification.
@@ -1169,33 +1174,33 @@ Contributions of any kind welcome!
11691174

11701175
MIT
11711176

1177+
<!-- prettier-ignore-start -->
11721178
[jest]: https://facebook.github.io/jest/
11731179
[dom-testing-library]: https://github.com/testing-library/dom-testing-library
11741180
[react-testing-library]:
11751181
https://github.com/testing-library/react-testing-library
11761182
[npm]: https://www.npmjs.com/
11771183
[node]: https://nodejs.org
1178-
[build-badge]:
1179-
https://img.shields.io/travis/testing-library/jest-dom.svg?style=flat-square
1180-
[build]: https://travis-ci.org/testing-library/jest-dom
1181-
[coverage-badge]:
1184+
[build-badge]: https://img.shields.io/github/workflow/status/testing-library/jest-dom/validate?logo=github&style=flat-square
1185+
[build]: https://github.com/testing-library/jest-dom/actions?query=workflow%3Avalidate
1186+
[coverage-badge]:
11821187
https://img.shields.io/codecov/c/github/testing-library/jest-dom.svg?style=flat-square
11831188
[coverage]: https://codecov.io/github/testing-library/jest-dom
11841189
[version-badge]:
1185-
https://img.shields.io/npm/v/@testing-library/jest-dom.svg?style=flat-square
1190+
https://img.shields.io/npm/v/@testing-library/jest-dom.svg?style=flat-square
11861191
[package]: https://www.npmjs.com/package/@testing-library/jest-dom
1187-
[downloads-badge]:
1192+
[downloads-badge]:
11881193
https://img.shields.io/npm/dm/@testing-library/jest-dom.svg?style=flat-square
11891194
[npmtrends]: http://www.npmtrends.com/@testing-library/jest-dom
1190-
[license-badge]:
1195+
[license-badge]:
11911196
https://img.shields.io/npm/l/@testing-library/jest-dom.svg?style=flat-square
11921197
[license]: https://github.com/testing-library/jest-dom/blob/master/LICENSE
1193-
[prs-badge]:
1198+
[prs-badge]:
11941199
https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square
11951200
[prs]: http://makeapullrequest.com
1196-
[coc-badge]:
1201+
[coc-badge]:
11971202
https://img.shields.io/badge/code%20of-conduct-ff69b4.svg?style=flat-square
1198-
[coc]:
1203+
[coc]:
11991204
https://github.com/testing-library/jest-dom/blob/master/other/CODE_OF_CONDUCT.md
12001205
[github-watch-badge]:
12011206
https://img.shields.io/github/watchers/testing-library/jest-dom.svg?style=social
@@ -1207,8 +1212,11 @@ MIT
12071212
https://twitter.com/intent/tweet?text=Check%20out%20jest-dom%20by%20%40gnapse%20https%3A%2F%2Fgithub.com%2Ftesting-library%2Fjest-dom%20%F0%9F%91%8D
12081213
[twitter-badge]:
12091214
https://img.shields.io/twitter/url/https/github.com/testing-library/jest-dom.svg?style=social
1210-
[emojis]: https://allcontributors.org/docs/en/emoji-key
1215+
[emojis]: https://github.com/all-contributors/all-contributors#emoji-key
12111216
[all-contributors]: https://github.com/all-contributors/all-contributors
1217+
[all-contributors-badge]:
1218+
https://img.shields.io/github/all-contributors/testing-library/jest-dom?color=orange&style=flat-square
12121219
[guiding-principle]: https://testing-library.com/docs/guiding-principles
12131220
[discord-badge]: https://img.shields.io/discord/723559267868737556.svg?color=7389D8&labelColor=6A7EC2&logo=discord&logoColor=ffffff&style=flat-square
12141221
[discord]: https://discord.gg/c6JN9fM
1222+
<!-- prettier-ignore-end -->

0 commit comments

Comments
 (0)