Skip to content

Commit 2903eef

Browse files
authored
chore: switch to github actions (#44)
* chore: switch to github actions * chore: replace build badge * fix: url typo
1 parent 27e175f commit 2903eef

File tree

3 files changed

+92
-21
lines changed

3 files changed

+92
-21
lines changed

.github/workflows/validate.yml

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
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: [12, 14, 16]
20+
runs-on: ubuntu-latest
21+
steps:
22+
- name: 🛑 Cancel Previous Runs
23+
uses: styfle/[email protected]
24+
25+
- name: ⬇️ Checkout repo
26+
uses: actions/checkout@v2
27+
28+
- name: ⎔ Setup node
29+
uses: actions/setup-node@v2
30+
with:
31+
node-version: ${{ matrix.node }}
32+
33+
- name: 📥 Download deps
34+
uses: bahmutov/npm-install@v1
35+
with:
36+
useLockFile: false
37+
env:
38+
HUSKY_SKIP_INSTALL: true
39+
40+
- name: ▶️ Run validate script
41+
run: npm run validate
42+
43+
- name: ⬆️ Upload coverage report
44+
uses: codecov/codecov-action@v2
45+
46+
release:
47+
needs: main
48+
runs-on: ubuntu-latest
49+
if:
50+
${{ github.repository == 'testing-library/preact-testing-library' &&
51+
contains('refs/heads/master,refs/heads/beta,refs/heads/next,refs/heads/alpha', github.ref) &&
52+
github.event_name == 'push' }}
53+
steps:
54+
- name: 🛑 Cancel Previous Runs
55+
uses: styfle/[email protected]
56+
57+
- name: ⬇️ Checkout repo
58+
uses: actions/checkout@v2
59+
60+
- name: ⎔ Setup node
61+
uses: actions/setup-node@v2
62+
with:
63+
node-version: 14
64+
65+
- name: 📥 Download deps
66+
uses: bahmutov/npm-install@v1
67+
with:
68+
useLockFile: false
69+
env:
70+
HUSKY_SKIP_INSTALL: true
71+
72+
- name: 🏗 Run build script
73+
run: npm run build
74+
75+
- name: 🚀 Release
76+
uses: cycjimmy/semantic-release-action@v2
77+
with:
78+
semantic_version: 17
79+
branches: |
80+
[
81+
'+([0-9])?(.{+([0-9]),x}).x',
82+
'master',
83+
'next',
84+
'next-major',
85+
{name: 'beta', prerelease: true},
86+
{name: 'alpha', prerelease: true}
87+
]
88+
env:
89+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
90+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.travis.yml

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

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,8 @@ kind welcome!
137137
<!-- prettier-ignore-start -->
138138
[npm]: https://www.npmjs.com
139139
[node]: https://nodejs.org
140-
[build]: https://travis-ci.org/testing-library/preact-testing-library
141-
[build-badge]: https://travis-ci.org/testing-library/preact-testing-library.svg?branch=master
140+
[build]: https://github.com/testing-library/preact-testing-library/actions?query=workflow%3Avalidate
141+
[build-badge]: https://img.shields.io/github/workflow/status/testing-library/preact-testing-library/validate?logo=github&style=flat-square
142142
[coverage-badge]: https://img.shields.io/codecov/c/github/testing-library/preact-testing-library.svg?style=flat-square
143143
[coverage]: https://codecov.io/github/testing-library/preact-testing-library
144144
[package]: https://www.npmjs.com/package/@testing-library/preact

0 commit comments

Comments
 (0)