Skip to content

Install dependencies before running component #49

Install dependencies before running component

Install dependencies before running component #49

Workflow file for this run

---
name: Molecule Run
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
molecule:
runs-on: ubuntu-latest
env:
DOCKER_USER: ${{ github.actor }}
DOCKER_PW: ${{ secrets.GITHUB_TOKEN }}
DOCKER_REGISTRY: ghcr.io
ANSIBLE_FORCE_COLOR: '1'
ANSIBLE_STDOUT_CALLBACK: yaml
MOLECULE_CONFIG: molecule/ext/molecule-src/molecule.yml
REQUIREMENTS_FILE: requirements.txt
PLAYBOOK_DIR: ../../../ # relative to molecule/ext/molecule-src/molecule.yml
CRUN_VER: 1.11.2
steps:
- name: Workaround crun issue on ubuntu # https://github.com/UtrechtUniversity/SRC-catalog-items/issues/3
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
- run: git clone https://github.com/UtrechtUniversity/SRC-molecule-test.git molecule
- run: mkdir molecule/ext && cd molecule/ext && ln -s ../../ molecule-src
- run: pip install -r ${{ env.REQUIREMENTS_FILE }}
- run: ansible-galaxy install -r requirements.yml
- name: Molecule tests
run: |
molecule -vv -c ${{ env.MOLECULE_CONFIG }} test