Skip to content

RavenDB-17135: add sanity wf tests, docs, fix linting and syntax rules #14

RavenDB-17135: add sanity wf tests, docs, fix linting and syntax rules

RavenDB-17135: add sanity wf tests, docs, fix linting and syntax rules #14

name: CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
schedule:
- cron: "0 10 * * 1" # every Monday at 10:00 UTC
jobs:
sanity:
name: Ansible Sanity Tests
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10"]
ansible-core:
- stable-2.15
- stable-2.16
- stable-2.17
include:
- python-version: "3.10"
ansible-core: devel
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Fix collection path for ansible-test #should be removed once we restructre
run: |
mkdir -p ansible_collections/ravendb/community
mv !(ansible_collections) ansible_collections/ravendb/community
cd ansible_collections/ravendb/community
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install "ansible-core@https://github.com/ansible/ansible/archive/${{ matrix.ansible-core }}.tar.gz"
- name: Run ansible-test sanity
run: |
ansible-test sanity --python ${{ matrix.python-version }} --docker -v --color
test-debian-setup-scenarios:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python 3
uses: actions/setup-python@v2
with:
python-version: "3.x"
- name: Cache pip dependencies
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install ansible molecule molecule-docker docker
- name: Set ansible roles path
run: echo "ANSIBLE_ROLES_PATH=$GITHUB_WORKSPACE/roles" >> $GITHUB_ENV
- name: Run molecule unsecured scenario
working-directory: roles/ravendb_node
run: molecule test -s unsecured
- name: Run molecule update scenario
working-directory: roles/ravendb_node
run: molecule test -s update
- name: Run molecule clenaup scenario
working-directory: roles/ravendb_node
run: molecule test -s cleanup
test-rhel-setup-scenarios:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python 3
uses: actions/setup-python@v2
with:
python-version: "3.x"
- name: Cache pip dependencies
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install ansible molecule molecule-docker docker
- name: Set ansible roles path
run: echo "ANSIBLE_ROLES_PATH=$GITHUB_WORKSPACE/roles" >> $GITHUB_ENV
- name: Run molecule unsecured-rhel scenario
working-directory: roles/ravendb_node
run: molecule test -s unsecured-rhel
- name: Run molecule update-rhel scenario
working-directory: roles/ravendb_node
run: molecule test -s update-rhel
- name: Run molecule clenaup-rhel scenario
working-directory: roles/ravendb_node
run: molecule test -s cleanup-rhel
test-ravendb-modules:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python 3
uses: actions/setup-python@v2
with:
python-version: "3.x"
- name: Cache pip dependencies
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip
restore-keys: |
${{ runner.os }}-pip-
- name: Install ASP.NET Core Runtime
run: |
wget https://dot.net/v1/dotnet-install.sh -O dotnet-install.sh
chmod +x dotnet-install.sh
./dotnet-install.sh --runtime aspnetcore --channel 8.0
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install ansible molecule molecule-docker docker ravendb_test_driver
- name: Build ansible galaxy collection
run: |
ansible-galaxy collection build .
ansible-galaxy collection install ./community-ravendb-*.tar.gz --force -p ./
- name: Set up .NET environment variables
run: |
export DOTNET_ROOT=$HOME/.dotnet
export PATH=$PATH:$HOME/.dotnet
source ~/.bashrc
- name: Change to ravendb_node role directory
run: cd roles/ravendb_node
- name: Run modules unit tests
run: python3 -m unittest discover -s tests/unit -v