Skip to content

Commit 9d9f5d1

Browse files
committed
Add CI setup
1 parent 454ec8c commit 9d9f5d1

File tree

2 files changed

+81
-0
lines changed

2 files changed

+81
-0
lines changed

.editorconfig

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
root = true
2+
3+
[*]
4+
end_of_line = lf
5+
insert_final_newline = true
6+
indent_style = space
7+
indent_size = 4
8+
trim_trailing_whitespace = true
9+
10+
[package.json]
11+
indent_style = space
12+
indent_size = 2
13+
14+
[*.yml]
15+
indent_style = space
16+
indent_size = 2

.github/workflows/nodejs.yml

+65
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
branches: [master]
8+
9+
jobs:
10+
build:
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
matrix:
14+
os: [ubuntu-latest, windows-latest]
15+
node-version: [10.x, 12.x]
16+
steps:
17+
- uses: actions/checkout@v2
18+
- name: Use Node.js ${{ matrix.node-version }}
19+
uses: actions/setup-node@v1
20+
with:
21+
node-version: ${{ matrix.node-version }}
22+
- run: npm ci
23+
- run: npm run lint
24+
- run: npm test
25+
env:
26+
CI: true
27+
- run: npm run build
28+
package-ubuntu:
29+
runs-on: ubuntu-latest
30+
steps:
31+
- uses: actions/checkout@v2
32+
- name: Use Node.js 12.x
33+
uses: actions/setup-node@v1
34+
with:
35+
node-version: 12.x
36+
- run: npm ci
37+
- name: Test npm package with minimal requirements
38+
run: |
39+
npm pack
40+
PACKAGE="exifreader-$(node -p "require('./package.json').version").tgz"
41+
mkdir my-project
42+
cd my-project
43+
PATH=$(echo "$PATH" | sed -e 's/:\/usr\/local\/bin://'):/usr/local/bin/npm:/usr/local/bin/node
44+
npm init -y
45+
npm install ../$PACKAGE
46+
package-windows:
47+
runs-on: windows-latest
48+
steps:
49+
- uses: actions/checkout@v2
50+
- name: Use Node.js 12.x
51+
uses: actions/setup-node@v1
52+
with:
53+
node-version: 12.x
54+
- run: npm ci
55+
- name: Test npm package with minimal requirements
56+
run: |
57+
npm pack
58+
$PackageVersion = ((node -p "require('./package.json').version") | Out-String).Trim()
59+
mkdir my-project
60+
cd my-project
61+
$regexRemovePath = [regex]::Escape('C:\npm\prefix')
62+
$arrPath = $env:Path -split ';' | Where-Object {$_ -notMatch "^$regexRemovePath\\?"}
63+
$env:Path = $arrPath -join ';'
64+
npm init -y
65+
npm install ..\exifreader-$($PackageVersion).tgz

0 commit comments

Comments
 (0)