diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..70d5fca --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,45 @@ +--- + +name: Deployment + +on: # yamllint disable-line rule:truthy + - push + - pull_request + +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + distribution: + - dist: almalinux + version: '9' + - dist: centos + version: 9-Stream + - dist: rockylinux + version: '9' + + steps: + - uses: actions/checkout@v4 + + - name: install dependencies + run: pip3 install ansible + + - name: install elan.opencast_repository + run: ansible-galaxy install elan.opencast_repository + + - name: create lxc container + uses: lkiesow/setup-lxc-container@v1 + with: + dist: ${{ matrix.distribution.dist }} + release: ${{ matrix.distribution.version }} + + - name: deploy opensearch + working-directory: .test + run: ansible-playbook -i test, test.yml + + - name: test that opensearch is running + run: > + curl --fail --silent + --retry 30 --retry-delay 1 --retry-all-errors + http://test:9200/ diff --git a/.test/roles/elan.opencast_opensearch b/.test/roles/elan.opencast_opensearch new file mode 120000 index 0000000..c25bddb --- /dev/null +++ b/.test/roles/elan.opencast_opensearch @@ -0,0 +1 @@ +../.. \ No newline at end of file diff --git a/.test/test.yml b/.test/test.yml new file mode 100644 index 0000000..cb97100 --- /dev/null +++ b/.test/test.yml @@ -0,0 +1,9 @@ +--- +- name: Test Deployment + hosts: all + become: true + roles: + - role: elan.opencast_repository + opencast_version_major: 16 + - role: elan.opencast_opensearch + opensearch_api_host: '0.0.0.0'