mirror of
https://github.com/ansible-collections/community.mysql.git
synced 2025-04-28 13:21:26 -07:00
Revert to old workflow to use ansible-test --venv
It seams that that ansible-test-gh-action doesn't handle this option: https://github.com/ansible-community/ansible-test-gh-action/blob/main/action.yml#L483-L497
This commit is contained in:
parent
f2c2173cfd
commit
d06cefa62d
1 changed files with 41 additions and 24 deletions
65
.github/workflows/ansible-test-plugins.yml
vendored
65
.github/workflows/ansible-test-plugins.yml
vendored
|
@ -90,32 +90,49 @@ jobs:
|
||||||
- python: 3.9
|
- python: 3.9
|
||||||
ansible: stable-2.12
|
ansible: stable-2.12
|
||||||
|
|
||||||
|
# runs all of the steps inside the specified container rather than on the VM host.
|
||||||
|
# Because of this the network configuration changes from host based network to a container network.
|
||||||
|
services:
|
||||||
|
mariadb105:
|
||||||
|
container_name: mariadb105
|
||||||
|
image: mariadb:10.5
|
||||||
|
env:
|
||||||
|
MARIADB_ROOT_PASSWORD: msandbox
|
||||||
|
ports:
|
||||||
|
- 3307:3306
|
||||||
|
# needed because the mariadb container does not provide a healthcheck
|
||||||
|
options: --health-cmd mysqladmin ping -P 3306 -pmsandbox | grep alive || exit 1
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: >-
|
- name: Check out code
|
||||||
Perform integration testing against
|
uses: actions/checkout@v2
|
||||||
Ansible version ${{ matrix.ansible }}
|
|
||||||
under Python ${{ matrix.python }}
|
|
||||||
uses: ansible-community/ansible-test-gh-action@release/v1
|
|
||||||
with:
|
with:
|
||||||
ansible-core-version: ${{ matrix.ansible }}
|
path: ansible_collections/community/mysql
|
||||||
pre-test-cmd: >-
|
|
||||||
DB_ENGINE=$(echo '${{ matrix.db_engine_version }}' | awk -F_ '{print $1}');
|
- name: Set up Python
|
||||||
DB_VERSION=$(echo '${{ matrix.db_engine_version }}' | awk -F_ '{print $2}');
|
uses: actions/setup-python@v2
|
||||||
DB_ENGINE_PRETTY=$([[ "${DB_ENGINE}" == 'mysql' ]] && echo 'MySQL' || echo 'MariaDB');
|
with:
|
||||||
>&2 echo Matrix factor for the DB is ${{ matrix.db_engine_version }}...;
|
python-version: ${{ matrix.python }}
|
||||||
>&2 echo Setting ${DB_ENGINE_PRETTY} version to ${DB_VERSION}...;
|
|
||||||
sed -i -e "s/^${DB_ENGINE}_version:.*/${DB_ENGINE}_version: $DB_VERSION/g" -e 's/^mariadb_install: false/mariadb_install: true/g' '${{ env.mysql_version_file }}';
|
- name: Install ansible-base (${{ matrix.ansible }})
|
||||||
${{
|
run: pip install https://github.com/ansible/ansible/archive/${{ matrix.ansible }}.tar.gz --disable-pip-version-check
|
||||||
matrix.db_engine_version == 'mariadb_10.8.3'
|
|
||||||
&& format(
|
- name: Set Connector version (${{ matrix.connector }})
|
||||||
'>&2 echo Set MariaDB v10.8.3 URL sub dir...; sed -i -e "s/^mariadb_url_subdir:.*/mariadb_url_subdir: linux-systemd/g" "{0}";', env.connector_version_file
|
run: "sed -i 's/^python_packages:.*/python_packages: [${{ matrix.connector }}]/' ${{ env.connector_version_file }}"
|
||||||
)
|
|
||||||
|| ''
|
# TODO, add a loop that wait on mariadb container healthcheck here
|
||||||
}}
|
|
||||||
>&2 echo Setting Connector version to ${{ matrix.connector }}...;
|
- name: Run integration tests
|
||||||
sed -i 's/^python_packages:.*/python_packages: [${{ matrix.connector }}]/' ${{ env.connector_version_file }}
|
run: ansible-test integration --venv -v --color --retry-on-error --continue-on-error --python ${{ matrix.python }} --diff --coverage
|
||||||
target-python-version: ${{ matrix.python }}
|
working-directory: ./ansible_collections/community/mysql
|
||||||
testing-type: integration
|
|
||||||
|
- name: Generate coverage report.
|
||||||
|
run: ansible-test coverage xml -v --requirements --group-by command --group-by version
|
||||||
|
working-directory: ./ansible_collections/community/mysql
|
||||||
|
|
||||||
|
- uses: codecov/codecov-action@v1
|
||||||
|
with:
|
||||||
|
fail_ci_if_error: false
|
||||||
|
|
||||||
units:
|
units:
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue