diff --git a/.ansible-lint b/.ansible-lint index 761ce48..6a21f08 100644 --- a/.ansible-lint +++ b/.ansible-lint @@ -6,6 +6,7 @@ exclude_paths: - molecule/ext # since this is a subtree, linting should be taken care of upstream - molecule/*/extra_prepare.yml # these are included with 'include_tasks' and hence do not validate as playbooks - docker-compose.yml + - molecule/*/.env.yml skip_list: - role-name - var-naming diff --git a/.github/workflows/ansible_lint.yml b/.github/workflows/ansible_lint.yml index e570f27..1c831dc 100644 --- a/.github/workflows/ansible_lint.yml +++ b/.github/workflows/ansible_lint.yml @@ -30,9 +30,25 @@ jobs: build: name: Ansible Lint # Naming the build is important to use it as a status check runs-on: ubuntu-latest + env: + VIRTUAL_ENV: ${{ github.workspace }}/.venv steps: - - uses: actions/checkout@v4 - - name: Run ansible-lint - uses: ansible/ansible-lint@main + - name: Set Up Python + uses: actions/setup-python@v7 with: - args: "." + python-version: '3.12' + + - name: Set up UV and caching + uses: astral-sh/setup-uv@v9.0.0 + with: + enable-cache: true + + - uses: actions/checkout@v7 + - name: Install Dependencies + run: | + uv venv $VIRTUAL_ENV + uv pip install ansible-lint + + - name: Run Ansible Lint + run: | + uv run ansible-lint . diff --git a/README.md b/README.md index 846bac3..b8b367d 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,9 @@ Additionally, you can create multiple test *scenarios*, in order to test the exe This repository contains some Molecule configuration files in `molecule/ext/molecule-src`. This setup is geared towards testing ResearchCloud components. It configures default container images, and [mimics certain other features of ResearchCloud workspaces](https://github.com/UtrechtUniversity/SRC-molecule#scenarios). -**Note: for `molecule` to run correctly, the path to the component playbook should be correctly set in `molecule/default/molecule.yml! It defaults to the default `playbook.yml`, but if you rename this file, be sure to change in the `molecule.yml`, too.** +**Note: for `molecule` to run correctly, the path to the component playbook should be correctly set in `molecule/default/.env.yml`! It defaults to the default `playbook.yml`, but if you rename this file, be sure to change in the `molecule.yml`, too.** + +**Note: parameters that should be passed to your playbook by molecule should be set in `molecule/default/.env.yml`!** To run `molecule`: diff --git a/molecule/default/.env.yml b/molecule/default/.env.yml new file mode 100644 index 0000000..3f9b4ca --- /dev/null +++ b/molecule/default/.env.yml @@ -0,0 +1,5 @@ +components: + - name: test_component + path: playbook.yml + parameters: + # Add parameters that you expect to be set in the ResearchCloud portal diff --git a/molecule/default/molecule.yml b/molecule/default/molecule.yml index 5b04fb0..030323b 100644 --- a/molecule/default/molecule.yml +++ b/molecule/default/molecule.yml @@ -1,9 +1,10 @@ --- -provisioner: - name: ansible - env: - components: - - name: test_component - path: playbook.yml - parameters: - # Add parameters that you expect to be set in the ResearchCloud portal +driver: + name: podman +platforms: + - name: workspace-src-ubuntu_jammy + image: ghcr.io/utrechtuniversity/src-test-workspace:ubuntu_noble-nginx # you can optionally change to a non-nginx image + command: /sbin/init + pre_build_image: true + published_ports: # this is not necessary if not testing against nginx + - 8080:80