Skip to content

Commit 5cf0649

Browse files
authored
s/travis/github actions/ (#108)
* s/travis/github actions/ * Run on all pull requests * Matrix is handled by karma
1 parent 9933f97 commit 5cf0649

File tree

5 files changed

+52
-6
lines changed

5 files changed

+52
-6
lines changed

.github/workflows/publish.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Publish
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
publish:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
- uses: actions/setup-node@v2
13+
with:
14+
node-version: 14
15+
registry-url: 'https://registry.npmjs.org'
16+
- run: npm ci
17+
- run: npm publish
18+
env:
19+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
20+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/tests.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ '*' ]
8+
9+
jobs:
10+
tests:
11+
12+
runs-on: ubuntu-latest
13+
14+
strategy:
15+
matrix:
16+
node-version: [16.x]
17+
18+
steps:
19+
- uses: actions/checkout@v2
20+
- name: Use Node.js ${{ matrix.node-version }}
21+
uses: actions/setup-node@v2
22+
with:
23+
node-version: ${{ matrix.node-version }}
24+
- run: npm ci
25+
- run: npm run lint
26+
- run: npm test
27+
env:
28+
SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }}
29+
SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }}

.travis.yml

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

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@
3535
},
3636
"scripts": {
3737
"start": "grunt",
38-
"test": "npm run lint && karma start karma.conf.js",
38+
"test": "karma start karma.conf.js",
3939
"lint": "eslint smartcrop.js test examples/slideshow.js examples/testbed.js examples/testsuite.js examples/smartcrop-debug.js"
4040
},
4141
"dependencies": {}
42-
}
42+
}

scripts/sync-web.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
for f in examples/*.{html,js,css}; do
33
gzip -k $f
44
done
5-
rsync -vLr examples smartcrop.js doc/example.jpg 29a.ch:/var/www/static/sandbox/2014/smartcrop/
5+
rsync -vLr examples smartcrop.js doc/example.jpg x.29a.ch:/var/www/static/sandbox/2014/smartcrop/
66
rm examples/*.gz

0 commit comments

Comments
 (0)