Merge ~woutervb/various/+git/snapstore-proxy-charm:github_actions into ~woutervb/various/+git/snapstore-proxy-charm:main

Proposed by Wouter van Bommel
Status: Merged
Merged at revision: 53fa1514e0e02e48936e2af1352188bbcbb349d2
Proposed branch: ~woutervb/various/+git/snapstore-proxy-charm:github_actions
Merge into: ~woutervb/various/+git/snapstore-proxy-charm:main
Prerequisite: ~woutervb/various/+git/snapstore-proxy-charm:status_action_test_refactor
Diff against target: 80 lines (+67/-0)
2 files modified
.github/workflows/buildcharm.yaml (+26/-0)
.github/workflows/tests.yaml (+41/-0)
Reviewer Review Type Date Requested Status
Przemysław Suliga (community) Approve
Wouter van Bommel Pending
Review via email: mp+413057@code.launchpad.net

Commit message

Add github actions

Allow to build a charm when a release is created, and automatically run tests on MR

To post a comment you must log in.
Revision history for this message
Przemysław Suliga (suligap) wrote :

Didn't test it, but lgtm with one comment

review: Approve
Revision history for this message
Wouter van Bommel (woutervb) wrote :

Thanks, updated the code. Rebase etc

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/.github/workflows/buildcharm.yaml b/.github/workflows/buildcharm.yaml
0new file mode 1006440new file mode 100644
index 0000000..3f8e917
--- /dev/null
+++ b/.github/workflows/buildcharm.yaml
@@ -0,0 +1,26 @@
1on:
2 release:
3 types:
4 - released
5
6jobs:
7 default-version:
8 name: Setup default version
9 runs-on: ubuntu-18.04
10 strategy:
11 fail-fast: true
12 steps:
13 - name: Checkout
14 uses: actions/checkout@v2
15
16 - name: Configure LXD
17 run: |
18 sudo groupadd --force --system lxd
19 sudo usermod --append --groups lxd $USER
20 sudo snap start lxd
21 sudo lxd waitready --timeout=30
22 sudo lxd init --auto
23
24 - name: Build my Charm
25 run: |
26 sg lxd -c "charmcraft -v pack"
0\ No newline at end of file27\ No newline at end of file
diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml
1new file mode 10064428new file mode 100644
index 0000000..3239734
--- /dev/null
+++ b/.github/workflows/tests.yaml
@@ -0,0 +1,41 @@
1on:
2 # Trigger the workflow on push or pull request,
3 # but only for the main branch
4 push:
5 branches:
6 - main
7 pull_request:
8 branches:
9 - main
10
11jobs:
12 default-version:
13 name: Setup default version
14 runs-on: ubuntu-18.04
15 strategy:
16 fail-fast: true
17 matrix:
18 python-version: ["3.6", "3.8", "3.10"]
19 steps:
20 - name: Checkout
21 uses: actions/checkout@v2
22
23 - name: setup default python
24 uses: actions/setup-python@v2
25 with:
26 python-version: ${{ matrix.python-version }}
27
28 - name: Validate version
29 run: python --version
30
31 - name: determine the location
32 run: pwd
33
34 - name: get the directory listing
35 run: ls -al
36
37 - name: Run the lint
38 run: make lint
39
40 - name: Run coverage
41 run: make coverage

Subscribers

People subscribed via source and target branches

to all changes: