Skip to content

Commit b57aed4

Browse files
authored
chore: move CI to GitHub Actions (#139)
* chore: import Action script * chore: remove Travis and AppVeyor files * fix(action): last second version bump ftw * chore: update eslint for Node > 10.x * fix(action): skip `lint` on windows * fix(test): normalize newlines for windows * chore: add CI badge to readme
1 parent b7b9513 commit b57aed4

File tree

7 files changed

+52
-42
lines changed

7 files changed

+52
-42
lines changed

.eslintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
},
1919
"extends": "eslint:recommended",
2020
"parserOptions": {
21-
"ecmaVersion": 6,
21+
"ecmaVersion": 10,
2222
"sourceType": "module"
2323
}
2424
}

.github/workflows/ci.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
paths-ignore:
6+
- '*.md'
7+
- 'LICENSE'
8+
- 'index.d.ts'
9+
branches:
10+
- master
11+
pull_request:
12+
paths-ignore:
13+
- '*.md'
14+
- 'LICENSE'
15+
- 'index.d.ts'
16+
branches:
17+
- master
18+
19+
jobs:
20+
test:
21+
name: Node.js v${{ matrix.nodejs }} (${{ matrix.os }})
22+
runs-on: ${{ matrix.os }}
23+
strategy:
24+
matrix:
25+
nodejs: [10, 12, 14]
26+
os: [ubuntu-latest, windows-latest, macOS-latest]
27+
steps:
28+
- uses: actions/checkout@v2
29+
- uses: actions/setup-node@v1
30+
with:
31+
node-version: ${{ matrix.nodejs }}
32+
33+
- name: Install
34+
run: npm ci
35+
36+
- name: Linter
37+
if: matrix.os != 'windows-latest'
38+
run: npm run lint
39+
40+
- name: Test
41+
run: npm test

.travis.yml

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

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# rollup-plugin-svelte
1+
# rollup-plugin-svelte [![CI](https://github.com/sveltejs/rollup-plugin-svelte/workflows/CI/badge.svg)](https://github.com/sveltejs/rollup-plugin-svelte/actions)
22

33
Compile Svelte components.
44

@@ -36,7 +36,7 @@ export default {
3636
// By default, the client-side compiler is used. You
3737
// can also use the server-side rendering compiler
3838
generate: 'ssr',
39-
39+
4040
// ensure that extra attributes are added to head
4141
// elements for hydration (used with generate: 'ssr')
4242
hydratable: true,

appveyor.yml

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

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ class CssWriter {
110110

111111
// use `fileName` to prevent additional Rollup hashing
112112
context.emitFile({ type: 'asset', fileName: mapfile, source });
113-
}
113+
};
114114
}
115115

116116
write(dest = this.filename, map = !!this.map) {

test/index.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ const sander = require('sander');
99

1010
const plugin = require('..');
1111

12+
// TODO(lukeed) do this within uvu?
13+
const normalize = file => fs.readFileSync(file, 'utf8').replace(/\r?\n/g, '\n');
14+
1215
test('resolves using pkg.svelte', () => {
1316
const { resolveId } = plugin();
1417
assert.is(
@@ -405,8 +408,8 @@ test('bundles CSS deterministically', async () => {
405408
});
406409

407410
assert.fixture(
408-
fs.readFileSync('test/deterministic-css/dist/bundle.css', 'utf-8'),
409-
fs.readFileSync('test/deterministic-css/expected/bundle.css', 'utf-8')
411+
normalize('test/deterministic-css/dist/bundle.css'),
412+
normalize('test/deterministic-css/expected/bundle.css')
410413
);
411414
});
412415

@@ -534,8 +537,8 @@ test('handles filenames that happen to contain .svelte', async () => {
534537
}
535538

536539
assert.fixture(
537-
fs.readFileSync('test/filename-test/dist/bundle.css', 'utf-8'),
538-
fs.readFileSync('test/filename-test/expected/bundle.css', 'utf-8')
540+
normalize('test/filename-test/dist/bundle.css'),
541+
normalize('test/filename-test/expected/bundle.css')
539542
);
540543
});
541544

0 commit comments

Comments
 (0)