Skip to content

Merge pull request #99 from icatproject-contrib/eclipselink_oracle_ex… #214

Merge pull request #99 from icatproject-contrib/eclipselink_oracle_ex…

Merge pull request #99 from icatproject-contrib/eclipselink_oracle_ex… #214

Workflow file for this run

name: CI
on:
workflow_dispatch:
pull_request:
push:
branches:
- master
jobs:
run_all_roles:
name: Run all ICAT Ansible roles
runs-on: ubuntu-22.04
strategy:
matrix:
java_version: [11, 17, 21]
steps:
- name: Checkout ICAT Ansible
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Run apt update
run: sudo apt-get update
- name: Install requirements
run: pip install -r requirements.txt
# Prep for running the playbook
- name: Create hosts file
run: echo -e "[hosts_all]\nlocalhost ansible_connection=local" > hosts
- name: Prepare vault pass
run: echo -e "icattravispw" > vault_pass.txt
- name: Move vault to directory it'll get detected by Ansible
run: mv vault.yml group_vars/all
- name: Replace default payara user with Actions user
run: |
sed -i -e "s/^payara_user: \"glassfish\"/payara_user: \"runner\"/" group_vars/all/vars.yml
# Force hostname to localhost - bug fix for previous ICAT Ansible issues on Actions
- name: Change hostname to localhost
run: sudo hostname -b localhost
- name: Remove existing mysql
run: |
sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.mysqld
sudo apt-get remove --purge "mysql*"
sudo rm -rf /var/lib/mysql* /etc/mysql
- name: Run ICAT Ansible Playbook
run: |
ansible-playbook hosts_all.yml -i hosts --vault-password-file vault_pass.txt -e java_version=${{ matrix.java_version }} -vv