-
Notifications
You must be signed in to change notification settings - Fork 23
134 lines (100 loc) · 3.14 KB
/
pr.yml
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
name: PR checks
on: pull_request
env:
FLASK_SECRET_KEY: insecure_test_key
SECRET_KEY: insecure_test_key
jobs:
# build-and-publish-image:
# runs-on: ubuntu-latest
# steps:
# - name: Checkout Code
# uses: actions/checkout@v3
# - name: Use Node.js
# uses: actions/setup-node@v3
# - name: Build Assets
# run: |
# yarn install
# yarn run build-css
# yarn run build-js
# - name: Setup LXD
# uses: canonical/setup-lxd@main
# - name: Setup Rockcraft
# run: sudo snap install rockcraft --classic --channel=edge/12f
# - name: Pack Rock
# run: |
# ROCKCRAFT_ENABLE_EXPERIMENTAL_EXTENSIONS=true rockcraft pack
# ls
# - name: Publish Image
# run: >-
# skopeo --insecure-policy copy
# oci-archive:$(ls *.rock)
# docker://ghcr.io/canonical/dqlite.io:$(git rev-parse --short HEAD)
# --dest-creds "canonical:${{ secrets.GITHUB_TOKEN }}"
build-and-publish-charm:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Setup LXD
uses: canonical/setup-lxd@main
- name: Setup Charmcraft
run: sudo snap install charmcraft --classic --channel=edge/12f
- name: Pack charm
run: |
cd charm
charmcraft pack -v --verbosity debug
cd ..
- name: Upload charm
uses: actions/upload-artifact@v3
with:
name: charm-${git rev-parse --short HEAD}.charm
path: dqlite-io*.charm
lint-python:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install node dependencies
run: yarn install --immutable
- name: Install python dependencies
run: |
python3 -m pip install --upgrade pip
sudo pip3 install flake8 black
- name: Lint python
run: yarn lint-python
lint-scss:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: yarn install --immutable
- name: Lint scss
run: yarn lint-scss
test-python:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Install requirements
run: |
sudo apt-get update && sudo apt-get install --yes python3-setuptools
sudo pip3 install -r requirements.txt
- name: Install dependencies
run: sudo pip3 install coverage
- name: Install node dependencies
run: yarn install --immutable
- name: Build resources
run: yarn build
- name: Run tests with coverage
run: |
coverage run --source=. -m unittest discover tests
bash <(curl -s https://codecov.io/bash) -cF python
inclusive-naming-check:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Check inclusive naming
uses: canonical-web-and-design/inclusive-naming@main
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
reporter: github-pr-check
fail-on-error: true