Skip to content

Commit

Permalink
ci: add GitHub workflow
Browse files Browse the repository at this point in the history
This workflow is executed after each pull request and performs the
following operations:

- Deploy a cluster SEAPATH Debian
- Configure the cluster (deploy a VM and shutdown one node)
- Run the Selenium tests
- Wake up the node and clean the workspace

Signed-off-by: Tanguy Raufflet <tanguy.raufflet@savoirfairelinux.com>
  • Loading branch information
Tanguy Raufflet committed Aug 6, 2024
1 parent 560c30e commit 5f0ac50
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: CI Cockpit plugins

env:
WORK_DIR: /tmp/seapath_ci_${{ github.run_id }}_${{ github.run_attempt }}_${{ github.sha }}

on:
pull_request:
types: [opened, reopened, synchronize]
branches: [main]
workflow_dispatch:
workflow_call:

permissions:
actions: write
checks: write

jobs:
setup:
runs-on: runner-SFL

steps:
- name: Initialize sources
run: |
mkdir ${{ env.WORK_DIR }}; cd ${{ env.WORK_DIR }};
git clone -q -b debian-main https://github.com/seapath/ansible.git ansible;
####### -- Lien avec qcow2 (ln) qui doit être placé dans le runner à une place fixe
git clone -q -b main https://github.com/seapath/cockpit-plugin-tests.git ansible/tests/cockpit-plugin-tests;
echo "CI sources downloaded successfully";
- name: Configure the cluster & deploy a VM
run: |
cd ${{ env.WORK_DIR }}/ansible;
cqfd init;
cqfd -b prepare;
cqfd run ansible-playbook -i tests/cockpit-plugin-tests/ansible/inventory/cluster_definition.yml --skip-tags "package-install" tests/cockpit-plugin-tests/ansible/deploy_cluster_test_plugins.yml;
cqfd run ansible-playbook -i tests/cockpit-plugin-tests/ansible/inventory/cluster_definition.yml -i tests/cockpit-plugin-tests/ansible/inventory/vm_definition.yml playbooks/deploy_vms_cluster.yaml;
- name: Launch Cockpit plugins tests
run: |
cd ${{ env.WORK_DIR }}/ansible/tests/cockpit-plugin-tests;
cqfd init
cqfd -b all_tests
- name: Wake up the shutdown host
run: |
wakeonlan 54:B2:03:9F:50:8A
- name: Clean
run: rm -rf ${{ env.WORK_DIR }};

0 comments on commit 5f0ac50

Please sign in to comment.