workflows: Use branch head to run tests #17
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
--- | |
name: Test Environment Reuse | |
on: | |
- push | |
- pull_request | |
jobs: | |
test-environment-reuse: | |
name: Test environment reuse | |
runs-on: ubuntu-24.04 | |
steps: | |
- name: Clone the repository | |
uses: actions/checkout@v4 | |
- name: Deploy environment | |
# uses: rjeffman/FreeIPA-Cluster-Test@<version|main> | |
uses: ./ | |
with: | |
cluster_configuration: tests/environments/server_only.yaml | |
shutdown: false | |
- name: Update /etc/hosts | |
run: | | |
podman ps | |
podman exec server bash -c 'echo "$(hostname -I) $(hostname)"' | sudo tee -a /etc/hosts | |
- name: Install test dependencies | |
run: | | |
pip install pytest requests | |
- name: Run Pytest | |
# note that any command that needs to access the pod network | |
# should be executed with `podman unshare --rootless-netns` | |
run: | | |
podman unshare --rootless-netns pytest | |
- name: Shutdown environment | |
# uses: rjeffman/FreeIPA-Cluster-Test@<version|main> | |
uses: ./ | |
with: | |
cluster_configuration: tests/environments/server_only.yaml | |
shutdown: true |