Skip to content

Commit 60f5e6f

Browse files
authored
Merge pull request #25 from etimberg/github-actions
Migrate build system to GitHub actions
2 parents c7344a6 + 6d1eed0 commit 60f5e6f

20 files changed

+2317
-4914
lines changed

.eslintrc.yml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
1-
extends: chartjs
2-
3-
parserOptions:
4-
ecmaVersion: 2018
5-
sourceType: 'module'
1+
extends:
2+
- chartjs
3+
- plugin:es/no-new-in-es2019
64

75
env:
8-
browser: true
96
es6: true
7+
browser: true
108
node: true
119

12-
rules:
13-
object-curly-spacing: [2, "always"]
10+
parserOptions:
11+
ecmaVersion: 2018
12+
sourceType: module
13+
ecmaFeatures:
14+
impliedStrict: true
15+
modules: true
16+
17+
plugins: ['es']

.github/release-drafter.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name-template: 'v$RESOLVED_VERSION'
2+
tag-template: 'v$RESOLVED_VERSION'
3+
categories:
4+
- title: 'Breaking Changes'
5+
labels:
6+
- 'breaking change'
7+
- title: 'Enhancements'
8+
labels:
9+
- 'enhancement'
10+
- title: 'Bugs Fixed'
11+
labels:
12+
- 'bug'
13+
- title: 'Types'
14+
labels:
15+
- 'types'
16+
- title: 'Documentation'
17+
labels:
18+
- 'documentation'
19+
- title: 'Development'
20+
labels:
21+
- 'chore'
22+
exclude-labels:
23+
- 'infrastructure'
24+
change-template: '- #$NUMBER $TITLE'
25+
change-title-escapes: '\<*_&`#@'
26+
version-resolver:
27+
major:
28+
labels:
29+
- 'breaking change'
30+
minor:
31+
labels:
32+
- 'enhancement'
33+
patch:
34+
labels:
35+
- 'bug'
36+
- 'chore'
37+
- 'types'
38+
default: patch
39+
template: |
40+
# Essential Links
41+
42+
* [npm](https://www.npmjs.com/package/chartjs-adapter-moment)
43+
44+
$CHANGES
45+
46+
Thanks to $CONTRIBUTORS

.github/workflows/ci.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Node.js CI
2+
3+
on:
4+
push:
5+
branches: [ master, v2 ]
6+
pull_request:
7+
branches: [ master, v2 ]
8+
9+
jobs:
10+
build:
11+
12+
runs-on: ${{ matrix.os }}
13+
14+
strategy:
15+
matrix:
16+
os: [ubuntu-latest, windows-latest]
17+
fail-fast: false
18+
19+
steps:
20+
- uses: actions/checkout@v2
21+
- name: Use Node.js
22+
uses: actions/setup-node@v1
23+
- run: |
24+
npm ci
25+
npm run build
26+
if [ "${{ runner.os }}" == "Windows" ]; then
27+
npm test
28+
else
29+
xvfb-run --auto-servernum npm test
30+
fi
31+
shell: bash
32+
- name: Coveralls Parallel - Chrome
33+
uses: coverallsapp/github-action@master
34+
with:
35+
github-token: ${{ secrets.github_token }}
36+
path-to-lcov: './coverage/chrome/lcov.info'
37+
flag-name: ${{ matrix.os }}-chrome
38+
parallel: true
39+
- name: Coveralls Parallel - Firefox
40+
uses: coverallsapp/github-action@master
41+
with:
42+
github-token: ${{ secrets.github_token }}
43+
path-to-lcov: './coverage/firefox/lcov.info'
44+
flag-name: ${{ matrix.os }}-firefox
45+
parallel: true
46+
47+
finish:
48+
needs: build
49+
runs-on: ubuntu-latest
50+
steps:
51+
- name: Coveralls Finished
52+
uses: coverallsapp/github-action@master
53+
with:
54+
github-token: ${{ secrets.github_token }}
55+
parallel-finished: true
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: Compressed Size
2+
3+
on: [pull_request]
4+
5+
jobs:
6+
build:
7+
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- uses: actions/checkout@v2
12+
- uses: preactjs/compressed-size-action@v2
13+
with:
14+
repo-token: "${{ secrets.GITHUB_TOKEN }}"

.github/workflows/npmpublish.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Node.js Package
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
setup:
9+
runs-on: ubuntu-latest
10+
outputs:
11+
version: ${{ steps.trim.outputs.version }}
12+
steps:
13+
- id: trim
14+
run: echo "::set-output name=version::${TAG:1}"
15+
env:
16+
TAG: ${{ github.event.release.tag_name }}
17+
18+
test:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v2
22+
- name: Use Node.js
23+
uses: actions/setup-node@v1
24+
- name: Test
25+
run: |
26+
npm ci
27+
xvfb-run --auto-servernum npm test
28+
29+
publish-npm:
30+
needs: [test, setup]
31+
runs-on: ubuntu-latest
32+
steps:
33+
- uses: actions/checkout@v2
34+
- uses: actions/setup-node@v1
35+
with:
36+
node-version: 12
37+
registry-url: https://registry.npmjs.org/
38+
- name: Setup and build
39+
run: |
40+
npm ci
41+
npm install -g json
42+
json -I -f package.json -e "this.version=\"$VERSION\""
43+
json -I -f package-lock.json -e "this.version=\"$VERSION\""
44+
npm run build
45+
npm pack
46+
env:
47+
VERSION: ${{ needs.setup.outputs.version }}
48+
- name: Publish @next
49+
run: npm publish --tag next
50+
if: "github.event.release.prerelease"
51+
env:
52+
NODE_AUTH_TOKEN: ${{secrets.NPM_AUTH_TOKEN}}
53+
- name: Publish @latest
54+
run: npm publish --tag latest
55+
if: "!github.event.release.prerelease"
56+
env:
57+
NODE_AUTH_TOKEN: ${{secrets.NPM_AUTH_TOKEN}}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Release Drafter
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- v2
8+
9+
jobs:
10+
correct_repository:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: fail on fork
14+
if: github.repository_owner != 'chartjs'
15+
run: exit 1
16+
17+
update_release_draft:
18+
needs: correct_repository
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: release-drafter/release-drafter@v5
22+
env:
23+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.travis.yml

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

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
This adapter allows the use of Moment.js with Chart.js. Moment.js is a very heavy library and thus not recommended for client-side development. However, it was previously the only library supported by Chart.js and so continues to be supported. You may prefer [chartjs-adapter-date-fns](https://github.com/chartjs/chartjs-adapter-date-fns) for a minimal bundle size or [chartjs-adapter-luxon](https://github.com/chartjs/chartjs-adapter-luxon) for larger bundle size with additional functionality included such as i18n and time zone support.
88

9-
Requires [Chart.js](https://github.com/chartjs/Chart.js/releases) **2.8.0** or later and [Moment.js](https://momentjs.com/) **2.0.0** or later.
9+
Requires [Chart.js](https://github.com/chartjs/Chart.js/releases) **3.0.0-beta.13** or later and [Moment.js](https://momentjs.com/) **2.0.0** or later. To use Chart.js v2.x, utilize v0.1.2 of the adapter.
1010

1111
**Note:** once loaded, this adapter overrides the default date-adapter provided in Chart.js (as a side-effect).
1212

gulpfile.js

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

0 commit comments

Comments
 (0)