-
Notifications
You must be signed in to change notification settings - Fork 119
38 lines (31 loc) · 1.3 KB
/
charmcraft-pack.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
name: Charmcraft Pack Test
on: [push, pull_request, workflow_call]
jobs:
charmcraft-pack:
runs-on: ubuntu-22.04
steps:
- name: Checkout test charm repository
uses: actions/checkout@v3
with:
repository: jnsgruk/hello-kubecon
- name: Update 'ops' dependency in test charm to latest
run: |
sed -i -e "/^ops[ ><=]/d" -e "/canonical\/operator/d" -e "/#egg=ops/d" requirements.txt
if [ -z "${{ github.event.pull_request.head.sha }}" ]
then
echo -e "\ngit+$GITHUB_SERVER_URL/$GITHUB_REPOSITORY@$GITHUB_SHA#egg=ops" >> requirements.txt
else
# If on a PR, we need to reference the PR branch's repo and commit (not the GITHUB_SHA
# temporary merge commit), because charmcraft pack does a git checkout which
# can't see the temporary merge commit.
echo -e "\ngit+${{ github.event.pull_request.head.repo.clone_url }}@${{ github.event.pull_request.head.sha }}#egg=ops" >> requirements.txt
fi
cat requirements.txt
- name: Set up LXD
uses: canonical/setup-lxd@ea57509243d3cf39f8ab926e021bb353947b01b5
with:
channel: 5.0/stable
- name: Install charmcraft
run: sudo snap install charmcraft --classic
- name: Pack the charm
run: sudo charmcraft pack --verbose