-
Notifications
You must be signed in to change notification settings - Fork 22
98 lines (97 loc) · 2.99 KB
/
_charm-quality-checks.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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
name: Quality Checks
on:
workflow_call:
inputs:
charm-path:
type: string
required: false
provider:
type: string
description: "The provider to choose for either machine or k8s tests ('lxd' or 'microk8s')"
required: true
ip-range:
type: string
description: |
The IP range in the address pool for the load balancer to use.
It can be either a subnet(IP/mask) or a range (<IP1>-<IP2>)
required: false
default: ""
secrets:
CHARMHUB_TOKEN:
required: false
jobs:
check-secret:
name: Check the CHARMHUB_TOKEN secret
runs-on: ubuntu-latest
outputs:
defined: ${{ steps.check.outputs.defined }}
steps:
- id: check
env:
CHARMHUB_TOKEN: ${{ secrets.CHARMHUB_TOKEN }}
if: "${{ env.CHARMHUB_TOKEN != '' }}"
run: echo "defined=true" >> $GITHUB_OUTPUT
call-inclusive-naming-check:
# Issues with this workflow can be addressed by adding a .wokeignore in the repository root
name: Inclusive naming
uses: canonical-web-and-design/Inclusive-naming/.github/workflows/woke.yaml@main
with:
fail-on-error: "true"
lib-check:
name: Check libraries
runs-on: ubuntu-latest
needs:
- check-secret
if: needs.check-secret.outputs.defined == 'true'
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 1
- name: Check charm libraries # Make sure our charm libraries are updated
uses: canonical/charming-actions/[email protected]
with:
credentials: "${{ secrets.CHARMHUB_TOKEN }}"
github-token: "${{ secrets.GITHUB_TOKEN }}"
charm-path: "${{ inputs.charm-path }}"
static-analysis:
name: Static Analysis
uses: nsklikas/observability/.github/workflows/_charm-static-analysis.yaml@main
with:
charm-path: "${{ inputs.charm-path }}"
linting:
name: Linting
uses: ./.github/workflows/_charm-linting.yaml@main
with:
charm-path: "${{ inputs.charm-path }}"
unit-test:
name: Unit Tests
uses: nsklikas/observability/.github/workflows/_charm-tests-unit.yaml@main
with:
charm-path: "${{ inputs.charm-path }}"
scenario-test:
name: Scenario Tests
uses: nsklikas/observability/.github/workflows/_charm-tests-scenario.yaml@main
with:
charm-path: "${{ inputs.charm-path }}"
integration-test:
name: Integration Tests
needs:
- static-analysis
- linting
- unit-test
- scenario-test
uses: nsklikas/observability/.github/workflows/_charm-tests-integration.yaml@main
with:
charm-path: "${{ inputs.charm-path }}"
provider: "${{ inputs.provider }}"
ip-range: ${{ inputs.ip-range }}
codeql:
name: CodeQL analysis
needs:
- static-analysis
- linting
- unit-test
uses: nsklikas/observability/.github/workflows/_charm-codeql-analysis.yml@main
with:
charm-path: "${{ inputs.charm-path }}"