Skip to content

Commit e73fc7b

Browse files
committed
Started working on snapshot workflow
1 parent 72df841 commit e73fc7b

File tree

1 file changed

+81
-0
lines changed

1 file changed

+81
-0
lines changed

.github/workflows/snapshot.yaml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: Create snapshot release
2+
on:
3+
push:
4+
branches:
5+
- *
6+
jobs:
7+
sonar:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Set up Git repository
11+
uses: actions/checkout@v2
12+
- name: Set up node
13+
uses: actions/setup-node@v2
14+
with:
15+
node-version: 14
16+
- name: Setup sonarqube
17+
uses: warchant/setup-sonar-scanner@v3
18+
- name: Setup Docker
19+
run: |
20+
docker pull s1hofmann/nut-ci:latest
21+
docker run -it -d --name nut-ci --shm-size 4gb --user $(id -u):$(id -g) -v ${PWD}:${PWD}:rw s1hofmann/nut-ci:latest bash
22+
- name: Install
23+
run: npm ci
24+
- name: Compile
25+
run: npm run compile
26+
- name: Init e2e test subpackage
27+
run: npm --prefix e2e/tests ci
28+
- name: Generate coverage report
29+
uses: GabrielBB/xvfb-action@v1
30+
with:
31+
run: |
32+
npm run coverage:clean
33+
npm run coverage -- --coverageDirectory=coverage/unit
34+
- uses: addnab/docker-run-action@v1
35+
with:
36+
image: s1hofmann/nut-ci
37+
shell: bash
38+
run: docker exec nut-ci bash -c "bash $PWD/.build/build.sh ${PWD} ${TRAVIS_NODE_VERSION}"
39+
- name: Merge coverage reports
40+
run: |
41+
npm run coverage:merge
42+
npm run coverage:merge-report
43+
- name: Run sonarqube
44+
env:
45+
# to get access to secrets.SONAR_TOKEN, provide GITHUB_TOKEN
46+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
47+
run: sonar-scanner
48+
-Dsonar.login=${{ secrets.SONAR_TOKEN }}
49+
-Dsonar.organization=nut-tree
50+
-Dsonar.host.url=https://sonarcloud.io/
51+
-Dsonar.projectKey=nut.js
52+
# test:
53+
# needs:
54+
# - sonar
55+
# strategy:
56+
# matrix:
57+
# os: [ macos-latest, windows-latest, ubuntu-latest ]
58+
# node: [ 10, 11, 12, 13, 14 ]
59+
# exclude:
60+
# - os: ubuntu-latest
61+
# node: 14
62+
# runs-on: ${{matrix.os}}
63+
# steps:
64+
# - name: Set up Git repository
65+
# uses: actions/checkout@v2
66+
# - name: Set up node
67+
# uses: actions/setup-node@v2
68+
# with:
69+
# node-version: ${{matrix.node}}
70+
# deploy:
71+
# needs:
72+
# - sonar
73+
# - test
74+
# runs-on: ubuntu-latest
75+
# steps:
76+
# - name: Set up Git repository
77+
# uses: actions/checkout@v2
78+
# - name: Set up node
79+
# uses: actions/setup-node@v2
80+
# with:
81+
# node-version: 14

0 commit comments

Comments
 (0)