Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI migration #1

Merged
merged 8 commits into from
May 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
102 changes: 102 additions & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
name: Build/Test

on:
workflow_call:

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install dependencies
run: python3 -m pip install tox

- name: Run linters
run: tox -e pep8

unit-test:
name: Unit tests
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install dependencies
run: |
sudo apt-get -qq install libxslt-dev libxml2-dev python3-lxml
python -m pip install tox

- name: Run tests
run: tox -e py3

build:
name: Build the charm
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1

- name: Setup LXD
uses: canonical/[email protected]
with:
channel: 5.20/stable

- name: Install dependencies
run: python -m pip install tox

- name: Build charm(s)
id: builder
run: |
sudo snap install charmcraft --classic
tox -e build

- name: Upload built charm
uses: actions/upload-artifact@v3
with:
name: charms
path: "*.charm"

functional-test:
needs:
- lint
- unit-test
- build
name: Functional tests
runs-on: ubuntu-latest
steps:

- name: Download charm
uses: actions/download-artifact@v3
with:
name: charms
path: ~/artifacts/

- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup LXD
uses: canonical/[email protected]
with:
# pin lxd to LTS release.
channel: 5.21/stable

- name: Install dependencies
run: |
python -m pip install tox
sudo snap install juju
mkdir -p ~/.local/share/juju
juju bootstrap localhost

- name: Run jammy-antelope tests
run: |
date
mv ~/artifacts/ceph-fs.charm ./
tox -c src -e func-target -- jammy-antelope
8 changes: 8 additions & 0 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: PR

on:
pull_request:

jobs:
build:
uses: ./.github/workflows/build-and-test.yml
3 changes: 2 additions & 1 deletion src/test-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ tox

# Functional Test Requirements (let Zaza's dependencies solve all dependencies here!)
git+https://github.com/openstack-charmers/zaza.git#egg=zaza
git+https://github.com/openstack-charmers/zaza-openstack-tests.git#egg=zaza.openstack
#git+https://github.com/openstack-charmers/zaza-openstack-tests.git#egg=zaza.openstack
git+https://github.com/lmlg/zaza-openstack-tests.git@ceph-fs-standalone#egg=zaza.openstack
44 changes: 0 additions & 44 deletions src/tests/bundles/focal-yoga.yaml

This file was deleted.

25 changes: 21 additions & 4 deletions src/tests/bundles/jammy-antelope.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,43 @@ local_overlay_enabled: False

series: &series jammy

machines:
'0':
'1':
constraints: virt-type=virtual-machine mem=4G
'2':
constraints: virt-type=virtual-machine mem=4G
'3':
constraints: virt-type=virtual-machine mem=4G

applications:
ubuntu: # used to test mounts
charm: ch:ubuntu
num_units: 2
to:
- '2'
- '3'

ceph-fs:
charm: ../../../ceph-fs.charm
charm: ch:ceph-fs
num_units: 1
options:
source: *openstack-origin
pool-type: erasure-coded
ec-profile-k: 4
ec-profile-m: 2
to:
- '2'

ceph-osd:
charm: ch:ceph-osd
num_units: 6
storage:
osd-devices: 'cinder,10G'
num_units: 1
options:
osd-devices: '/dev/test-non-existent'
source: *openstack-origin
channel: latest/edge
to:
- '1'

ceph-mon:
charm: ch:ceph-mon
Expand All @@ -35,6 +50,8 @@ applications:
monitor-count: '3'
source: *openstack-origin
channel: latest/edge
to:
- '0'

relations:
- - 'ceph-mon:mds'
Expand Down
44 changes: 0 additions & 44 deletions src/tests/bundles/jammy-bobcat.yaml

This file was deleted.

44 changes: 0 additions & 44 deletions src/tests/bundles/jammy-yoga.yaml

This file was deleted.

44 changes: 0 additions & 44 deletions src/tests/bundles/lunar-antelope.yaml

This file was deleted.

Loading
Loading