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
1diff --git a/.github/workflows/buildcharm.yaml b/.github/workflows/buildcharm.yaml
2new file mode 100644
3index 0000000..3f8e917
4--- /dev/null
5+++ b/.github/workflows/buildcharm.yaml
6@@ -0,0 +1,26 @@
7+on:
8+ release:
9+ types:
10+ - released
11+
12+jobs:
13+ default-version:
14+ name: Setup default version
15+ runs-on: ubuntu-18.04
16+ strategy:
17+ fail-fast: true
18+ steps:
19+ - name: Checkout
20+ uses: actions/checkout@v2
21+
22+ - name: Configure LXD
23+ run: |
24+ sudo groupadd --force --system lxd
25+ sudo usermod --append --groups lxd $USER
26+ sudo snap start lxd
27+ sudo lxd waitready --timeout=30
28+ sudo lxd init --auto
29+
30+ - name: Build my Charm
31+ run: |
32+ sg lxd -c "charmcraft -v pack"
33\ No newline at end of file
34diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml
35new file mode 100644
36index 0000000..3239734
37--- /dev/null
38+++ b/.github/workflows/tests.yaml
39@@ -0,0 +1,41 @@
40+on:
41+ # Trigger the workflow on push or pull request,
42+ # but only for the main branch
43+ push:
44+ branches:
45+ - main
46+ pull_request:
47+ branches:
48+ - main
49+
50+jobs:
51+ default-version:
52+ name: Setup default version
53+ runs-on: ubuntu-18.04
54+ strategy:
55+ fail-fast: true
56+ matrix:
57+ python-version: ["3.6", "3.8", "3.10"]
58+ steps:
59+ - name: Checkout
60+ uses: actions/checkout@v2
61+
62+ - name: setup default python
63+ uses: actions/setup-python@v2
64+ with:
65+ python-version: ${{ matrix.python-version }}
66+
67+ - name: Validate version
68+ run: python --version
69+
70+ - name: determine the location
71+ run: pwd
72+
73+ - name: get the directory listing
74+ run: ls -al
75+
76+ - name: Run the lint
77+ run: make lint
78+
79+ - name: Run coverage
80+ run: make coverage

Subscribers

People subscribed via source and target branches

to all changes: