-
Notifications
You must be signed in to change notification settings - Fork 12
71 lines (64 loc) · 1.93 KB
/
test-web-ui.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# GitHubActions for testing
# read the docs: https://help.github.com/en/actions/configuring-and-managing-workflows/configuring-a-workflow
name: WebUi Test
on:
workflow_dispatch:
push:
branches: [ 'master', '3.0-dev' ]
paths:
- '.github/workflows/test-web-ui.yaml'
- 'web-ui/**'
- '!web-ui/docs/**'
- '!web-ui/**.md'
- '!web-ui/**.rst'
- '!web-ui/LICENSE'
pull_request:
branches: [ 'master', '3.0-dev' ]
paths:
- '.github/workflows/test-web-ui.yaml'
- 'web-ui/**'
- '!web-ui/docs/**'
- '!web-ui/**.md'
- '!web-ui/**.rst'
- '!web-ui/LICENSE'
defaults:
run:
working-directory: web-ui
env:
project-directory: web-ui
jobs:
can-sonar:
runs-on: ubuntu-latest
outputs:
has_token: ${{ steps.has-token.outputs.has_token }}
steps:
- id: has-token
run: |
if [[ -n "$SONAR_TOKEN" ]]
then
echo '::set-output name=has_token::false'
fi
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
working-directory: .
sonarcloud:
name: SonarScanner
needs: [ 'can-sonar' ]
# have forks backed-up: Anyone without write access to a repository cannot read and use secrets
if: ${{ needs.can-sonar.outputs.has_token && ! cancelled() && github.repository_owner == 'k4cg' }}
runs-on: ubuntu-latest
steps:
- name: Fetch Code
# see https://github.com/actions/checkout
uses: actions/checkout@v2
with:
# Disabling shallow clone is recommended for improving relevancy of reporting
fetch-depth: 0
- name: SonarCloud Scan
# see https://github.com/SonarSource/sonarcloud-github-action
uses: sonarsource/[email protected]
with:
projectBaseDir: ${{ env.project-directory }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}