Skip to content

Commit dbb7d74

Browse files
committed
chore: Added tests-run github workflow and the corresponding status badge to the Readme.
1 parent fcc6422 commit dbb7d74

File tree

3 files changed

+34
-15
lines changed

3 files changed

+34
-15
lines changed

.github/workflows/tests-run.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Run Automated Tests
2+
on:
3+
issue_comment:
4+
types: [created]
5+
jobs:
6+
run_tests:
7+
if: |
8+
github.event_name == 'issue_comment' &&
9+
(github.event.comment.author_association == 'member' || github.event.comment.author_association == 'owner') &&
10+
startsWith(github.event.comment.body, '@tests run')
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v2
14+
with:
15+
fetch-depth: 0
16+
ref: main
17+
- uses: actions/setup-node@v2
18+
with:
19+
node-version: '14'
20+
- run: |
21+
if [ -f "yarn.lock" ]; then
22+
yarn install
23+
else
24+
npm install
25+
fi
26+
- run: |
27+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
28+
git config --global user.name "github-actions[bot]"
29+
- run: yarn test
30+
env:
31+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32+
SLACK_INCOMING_HOOK: ${{ secrets.SLACK_INCOMING_HOOK }}

.travis.yml

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

README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Uploadcare custom image loader for Next.js
2-
[![Build Status][build-img]][build-link]
2+
![Test Status][test-status-img]
33
[![NPM version][npm-img]][npm-link]
44

55
* [Demo](#demo)
@@ -170,9 +170,7 @@ Next checks whether the image url which loader generates has the exact value whi
170170

171171
**Fix:** Ignore the warning for now.
172172

173-
174-
[build-img]: https://app.travis-ci.com/uploadcare/nextjs-loader.svg?branch=main
175-
[build-link]: https://api.travis-ci.com/uploadcare/nextjs-loader
173+
[test-status-img]: https://github.com/uploadcare/nextjs-loader/actions/workflows/tests-run.yml/badge.svg
176174
[npm-img]: https://img.shields.io/npm/v/@uploadcare/nextjs-loader.svg
177175
[npm-link]: https://www.npmjs.com/package/@uploadcare/nextjs-loader
178176
[stackblitz-image]: https://developer.stackblitz.com/img/open_in_stackblitz.svg

0 commit comments

Comments
 (0)