Skip to content

Commit

Permalink
Run molecule tests in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
dometto committed Jun 18, 2024
1 parent 6f14068 commit f22283a
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 3 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/molecule.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
name: Molecule tests
on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:

molecule:
runs-on: ubuntu-latest
env:
ANSIBLE_FORCE_COLOR: '1'
ANSIBLE_STDOUT_CALLBACK: yaml
CRUN_VER: 1.11.2
REQUIREMENTS_FILE: molecule/requirements.txt
BOOTSTRAP_KEY: foobar # defines an api bootstrap key for the molecule tests
steps:
- name: Workaround crun issue on ubuntu
run: |
mkdir -p "${HOME}/.local/bin"
curl -L "https://github.com/containers/crun/releases/download/${CRUN_VER}/crun-${CRUN_VER}-linux-amd64" -o "${HOME}/.local/bin/crun"
chmod +x "${HOME}/.local/bin/crun"
crun --version
mkdir -p "${HOME}/.config/containers"
cat << EOF > "${HOME}/.config/containers/containers.conf"
[engine.runtimes]
crun = [
"${HOME}/.local/bin/crun",
"/usr/bin/crun"
]
EOF
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- run: pip install -r ${{ env.REQUIREMENTS_FILE }}
- name: Molecule tests
run: |
BOOTSTRAP_KEY=${{ env.BOOTSTRAP_KEY }} molecule -vvv test --all
2 changes: 1 addition & 1 deletion molecule/default/prepare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
vars:
rsc_nginx_authorization_endpoint: http://localhost
rsc_nginx_user_info_endpoint: http://localhost
rsc_nginx_service_url: http://localhost
rsc_nginx_service_url: localhost
nginx_enable_ssl: false
nginx_enable_auth: true
rsc_nginx_oauth2_application:
Expand Down
5 changes: 5 additions & 0 deletions molecule/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
molecule
molecule-plugins
jmespath~=1.0
requests~=2.31.0 # https://github.com/ansible-community/molecule-plugins/issues/256
podman~=4.0
4 changes: 2 additions & 2 deletions vars/nginx_vars.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
galaxy_nginx_vhost_config:
- name: galaxy
location: /
backend: http://galaxy
backend: "http://{{ _galaxy_local_address }}"
auth: "{{ _molecule_active | ternary(None, 'sram') | default(omit, true) }}"
- name: api
location: /api
backend: http://galaxy
backend: "http://{{ _galaxy_local_address }}/api"
auth: "{{ _galaxy_api_exposed | ternary('noauth', 'sram') | default(omit, true) }}"
- name: static
location: /static
Expand Down

0 comments on commit f22283a

Please sign in to comment.