Install Docs on pure environment #85
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: OneClickDocs-Install | |
run-name: Install Docs on pure environment | |
on: | |
pull_request: | |
types: [opened, reopened, synchronize] | |
paths-ignore: | |
- '.github/**' | |
- 'tests/**' | |
- '**/README.md' | |
workflow_dispatch: | |
schedule: | |
- cron: '0 21 * * 6' # At 21:00 on Saturday. | |
jobs: | |
get-version: | |
name: "Get ds version for test" | |
runs-on: ubuntu-latest | |
outputs: | |
ds-ver: ${{ steps.get-version.outputs.ds-ver }} | |
steps: | |
- name: get-version | |
id: get-version | |
shell: bash | |
run: | | |
if curl -s -L -H "Accept: application/vnd.github+json" https://api.github.com/repos/ONLYOFFICE/document-server-package/branches | jq -r '.[].name' | grep -qE '^release/'; then | |
VERSION=$(curl -s -L -H "Accept: application/vnd.github+json" https://api.github.com/repos/ONLYOFFICE/document-server-package/branches | jq -r '.[] | select(.name|test("^release/")) | .name' | awk -F '/v' '{print $2}') | |
else | |
VERSION=$(curl -s -L -H "Accept: application/vnd.github+json" https://api.github.com/repos/ONLYOFFICE/document-server-package/branches | jq -r '.[] | select(.name|test("^hotfix/")) | .name' | awk -F '/v' '{print $2}') | |
fi | |
echo "ds-ver=${VERSION:-99.99.99}" >> "$GITHUB_OUTPUT" | |
vagrant-up: | |
name: "Test Docs with ${{matrix.name}}" | |
needs: [get-version] | |
runs-on: ubuntu-latest | |
env: | |
VER: ${{ needs.get-version.outputs.ds-ver }} | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- distr: generic | |
os: centos7 | |
name: "CentOS 7" | |
- distr: generic | |
os: centos8s | |
name: "CentOS 8 Stream" | |
- distr: generic | |
os: centos9s | |
name: "CentOS 9 Stream" | |
- distr: generic | |
os: debian10 | |
name: "Debian 10" | |
- distr: generic | |
os: debian11 | |
name: "Debian 11" | |
- distr: generic | |
os: debian12 | |
name: "Debian 12" | |
- distr: ubuntu | |
os: bionic64 | |
name: "Ubuntu 18.04" | |
- distr: generic | |
os: ubuntu2004 | |
name: "Ubuntu 20.04" | |
- distr: generic | |
os: ubuntu2204 | |
name: "Ubuntu 22.04" | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Python 3. | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.x' | |
- name: Set up vagrant and virtualbox | |
run: | | |
sudo apt update -y | |
sudo apt install vagrant virtualbox -y | |
- name: Test production scripts | |
if: ${{ github.event_name == 'schedule' }} | |
uses: nick-fields/retry@v2 | |
with: | |
max_attempts: 2 | |
timeout_minutes: 40 | |
retry_on: error | |
command: | | |
set -eux | |
cd tests/vagrant | |
TEST_CASE='--production-install' \ | |
DISTR='${{ matrix.distr }}' \ | |
OS='${{ matrix.os }}' \ | |
DOWNLOAD_SCRIPT='-ds true' \ | |
RAM='6000' \ | |
CPU='3' \ | |
ARGUMENTS="-arg '--skiphardwarecheck true --makeswap false'" \ | |
vagrant up | |
on_retry_command: | | |
echo "RUN CLEAN UP: Destroy vagrant and one more try" | |
cd tests/vagrant | |
sleep 10 | |
vagrant destroy --force | |
- name: "Test Local scripts with ver: ${{ needs.get-version.outputs.ds-ver }}" | |
if: ${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }} | |
uses: nick-fields/retry@v2 | |
with: | |
max_attempts: 2 | |
timeout_minutes: 40 | |
retry_on: error | |
command: | | |
set -eux | |
cd tests/vagrant | |
TEST_CASE='--local-install' \ | |
DISTR='${{ matrix.distr }}' \ | |
OS='${{ matrix.os }}' \ | |
RAM='9100' \ | |
CPU='3' \ | |
VER='-v ${{ env.VER }}' \ | |
DOWNLOAD_SCRIPT='-ds false' \ | |
TEST_REPO='-tr true' \ | |
ARGUMENTS="-arg '--skiphardwarecheck true --makeswap false --localscripts true'" \ | |
vagrant up | |
on_retry_command: | | |
echo "RUN CLEAN UP: Destroy vagrant and one more try" | |
cd tests/vagrant | |
sleep 10 | |
vagrant destroy --force |