Commit | Line | Data |
---|---|---|
a9c0de45 | 1 | name: CI |
69d993b0 JB |
2 | on: |
3 | push: | |
4 | branches: | |
5 | - master | |
c4f11906 | 6 | pull_request: |
613dc1b7 | 7 | types: [opened, synchronize, reopened] |
69d993b0 JB |
8 | jobs: |
9 | build: | |
10 | runs-on: ubuntu-latest | |
11 | strategy: | |
12 | matrix: | |
99942e4f | 13 | node: ['14.x', '16.x', '18.x'] |
69d993b0 | 14 | steps: |
0642c3d2 | 15 | - uses: actions/checkout@v3 |
e7aeea18 JB |
16 | with: |
17 | fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis | |
0642c3d2 JB |
18 | - name: Use Node.js ${{ matrix.node }} |
19 | uses: actions/setup-node@v3 | |
e7aeea18 | 20 | with: |
0642c3d2 | 21 | node-version: ${{ matrix.node }} |
e7aeea18 JB |
22 | - name: npm install |
23 | run: npm ci | |
24 | - name: npm run lint | |
25 | run: npm run lint | |
26 | continue-on-error: true | |
27 | - name: npm run build | |
28 | run: npm run build | |
29 | - name: npm test | |
30 | run: npm test | |
31 | - name: npm run coverage | |
32 | run: npm run coverage | |
33 | - name: SonarCloud Scan | |
0642c3d2 | 34 | if: "github.repository == 'jerome-benoit/charging-stations-simulator' && matrix.node == '16.x'" |
e7aeea18 JB |
35 | uses: sonarsource/sonarcloud-github-action@master |
36 | env: | |
37 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any | |
38 | SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
a9c0de45 | 39 | build-docker: |
c168e7ad JB |
40 | runs-on: ubuntu-latest |
41 | steps: | |
0642c3d2 | 42 | - uses: actions/checkout@v3 |
e7aeea18 JB |
43 | - name: Set up Docker Buildx |
44 | id: buildx | |
45 | uses: docker/setup-buildx-action@v1 | |
46 | - name: Build docker image | |
47 | run: | | |
48 | cd docker | |
49 | make SUBMODULES_INIT=false |