[DPE-5767] - Add CI workflows #15
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright 2024 Canonical Ltd. | |
# See LICENSE file for licensing details. | |
name: Tests | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
on: | |
pull_request: | |
jobs: | |
build: | |
name: Build snap | |
uses: canonical/data-platform-workflows/.github/workflows/[email protected] | |
test: | |
name: Test snap | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Install dependencies | |
run: | | |
sudo snap install yq | |
- name: Download snap package(s) | |
uses: actions/download-artifact@v4 | |
with: | |
pattern: ${{ needs.build.outputs.artifact-prefix }}-* | |
merge-multiple: true | |
- name: Install snap package(s) | |
run: | | |
sudo snap install --dangerous charmed-etcd*.snap | |
- name: Check etcd service status and run etcdctl and etcdutl | |
run: | | |
sudo systemctl status snap.charmed-etcd.daemon.service | grep 'active (running)' | |
expected_version="$(cat snap/snapcraft.yaml | yq .version)" | |
version="$(curl -L http://127.0.0.1:2379/version | yq -p=json .etcdserver)" | |
if [ "$expected_version" != "$version" ]; then | |
echo "Error: etcd Version is ${version}, expected ${expected_version}" | |
exit 1 | |
fi | |
charmed-etcd.etcdctl version | |
charmed-etcd.etcdutl version | |
- name: Run tests | |
run: | | |
charmed-etcd.etcdctl endpoint health | grep 'is healthy' | |
charmed-etcd.etcdctl put greeting "Hello, etcd" | grep 'OK' | |
charmed-etcd.etcdctl get greeting | grep 'Hello, etcd' | |
- name: Run Performance checks | |
run: | | |
charmed-etcd.etcdctl check perf | grep 'PASS' |