Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Commit 88e79ea

Browse files
chore: move CI to github actions (react-native-sensors#398)
* chore: move CI to github actions * refactor: format files
1 parent e33b074 commit 88e79ea

File tree

6 files changed

+58
-30
lines changed

6 files changed

+58
-30
lines changed

.github/workflows/release.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Release
2+
on:
3+
push:
4+
branches:
5+
- master
6+
jobs:
7+
release:
8+
name: Release
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v2
13+
with:
14+
fetch-depth: 0
15+
- name: Setup Node.js
16+
uses: actions/setup-node@v1
17+
with:
18+
node-version: 12
19+
- name: Install dependencies
20+
run: npm ci
21+
- name: Release
22+
env:
23+
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
24+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
25+
run: npx semantic-release

.github/workflows/test.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
branches: [master]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
matrix:
15+
node-version: [12.x, 14.x]
16+
17+
steps:
18+
- uses: actions/checkout@v2
19+
- name: Use Node.js ${{ matrix.node-version }}
20+
uses: actions/setup-node@v2
21+
with:
22+
node-version: ${{ matrix.node-version }}
23+
- run: npm install
24+
- run: npm run build --if-present
25+
- run: npm test

.travis.yml

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

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/rnsensors.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const {
55
RNSensorsMagnetometer: MagnNative,
66
RNSensorsBarometer: BarNative,
77
RNSensorsOrientation: OrientNative,
8-
RNSensorsGravity: GravNative
8+
RNSensorsGravity: GravNative,
99
} = NativeModules;
1010

1111
if (!GyroNative && !AccNative && !MagnNative && !BarNative && !OrientNative && !GravNative) {
@@ -18,7 +18,7 @@ const nativeApis = new Map([
1818
["magnetometer", MagnNative],
1919
["barometer", BarNative],
2020
["orientation", OrientNative],
21-
["gravity", GravNative]
21+
["gravity", GravNative],
2222
]);
2323

2424
// Cache the availability of sensors

src/sensors.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const {
99
RNSensorsMagnetometer: MagnNative,
1010
RNSensorsBarometer: BarNative,
1111
RNSensorsOrientation: OrientNative,
12-
RNSensorsGravity: GravNative
12+
RNSensorsGravity: GravNative,
1313
} = NativeModules;
1414

1515
const listenerKeys = new Map([
@@ -18,7 +18,7 @@ const listenerKeys = new Map([
1818
["magnetometer", "Magnetometer"],
1919
["barometer", "Barometer"],
2020
["orientation", "Orientation"],
21-
["gravity", "Gravity"]
21+
["gravity", "Gravity"],
2222
]);
2323

2424
const nativeApis = new Map([
@@ -27,7 +27,7 @@ const nativeApis = new Map([
2727
["magnetometer", MagnNative],
2828
["barometer", BarNative],
2929
["orientation", OrientNative],
30-
["gravity", GravNative]
30+
["gravity", GravNative],
3131
]);
3232

3333
const eventEmitterSubscription = new Map([
@@ -36,7 +36,7 @@ const eventEmitterSubscription = new Map([
3636
["magnetometer", null],
3737
["barometer", null],
3838
["orientation", null],
39-
["gravity", null]
39+
["gravity", null],
4040
]);
4141

4242
function createSensorObservable(sensorType) {
@@ -93,5 +93,5 @@ export default {
9393
magnetometer,
9494
barometer,
9595
orientation,
96-
gravity
96+
gravity,
9797
};

0 commit comments

Comments
 (0)