diff --git a/.github/workflows/collection-continuous-integration.yml b/.github/workflows/collection-continuous-integration.yml new file mode 100644 index 00000000..3dc896bd --- /dev/null +++ b/.github/workflows/collection-continuous-integration.yml @@ -0,0 +1,97 @@ +name: Collection build and tests + +on: + push: + pull_request: + +jobs: + build-collection-artifact: + name: Build + runs-on: ${{ matrix.runner-os }} + strategy: + matrix: + runner-os: + - ubuntu-16.04 + ansible-version: + - git+https://github.com/ansible/ansible.git@devel + runner-python-version: + - 3.7 + steps: + - name: Check out ${{ github.repository }} on disk + uses: actions/checkout@master + - name: Set up Python ${{ matrix.runner-python-version }} + uses: actions/setup-python@v1 + with: + python-version: ${{ matrix.runner-python-version }} + - name: Set up pip cache + uses: actions/cache@v1 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('tests/sanity/requirements.txt') }}-${{ hashFiles('tests/unit/requirements.txt') }} + restore-keys: | + ${{ runner.os }}-pip- + ${{ runner.os }}- + - name: Install Ansible ${{ matrix.ansible-version }} + run: >- + python -m pip install --user '${{ matrix.ansible-version }}' + - name: Build a collection tarball + run: >- + ~/.local/bin/ansible-galaxy collection build --output-path + "${GITHUB_WORKSPACE}/.cache/collection-tarballs" + - name: Store migrated collection artifacts + uses: actions/upload-artifact@v1 + with: + name: collection + path: .cache/collection-tarballs + + sanity-test-collection-via-containers: + name: Sanity in container via Py-${{ matrix.python-version }} & ${{ matrix.ansible-version }} + needs: + - build-collection-artifact + runs-on: ${{ matrix.runner-os }} + strategy: + fail-fast: false + matrix: + runner-os: + - ubuntu-latest + runner-python-version: + - 3.7 + ansible-version: + - ansible<2.10 + - git+https://github.com/ansible/ansible.git@devel + python-version: + - 2.7 + - 3.7 + + steps: + - name: Set up Python ${{ matrix.runner-python-version }} + uses: actions/setup-python@v1 + with: + python-version: ${{ matrix.runner-python-version }} + - name: Set up pip cache + uses: actions/cache@v1 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ github.ref }}-sanity-containers + restore-keys: | + ${{ runner.os }}-pip- + ${{ runner.os }}- + - name: Install Ansible ${{ matrix.ansible-version }} + run: >- + python -m pip install --user '${{ matrix.ansible-version }}' + - name: Download migrated collection artifacts + uses: actions/download-artifact@v1 + with: + name: collection + path: .cache/collection-tarballs + - name: Install the collection tarball + run: >- + ~/.local/bin/ansible-galaxy collection install .cache/collection-tarballs/*.tar.gz + - name: Run collection sanity tests + run: >- + ~/.local/bin/ansible-test sanity --color --requirements --python "${{ matrix.python-version }}" -vvv + plugins/ tests/ + working-directory: >- + /home/runner/.ansible/collections/ansible_collections/containers/podman + +# When we have unit tests, add them here diff --git a/.github/workflows/connections_tests.yml b/.github/workflows/connections_tests.yml new file mode 100644 index 00000000..da2765e3 --- /dev/null +++ b/.github/workflows/connections_tests.yml @@ -0,0 +1,241 @@ +name: Test connection plugins + +on: + push: + paths: + - '.github/workflows/connections_tests.yml' + - 'ci/*.yml' + - 'ci/playbooks/connections/**' + - 'ci/run_connection_test.sh' + - 'plugins/connection/**' + - 'tests/integration/targets/connection/**' + - 'tests/integration/targets/connection_*/**' + branches: + - master + pull_request: + paths: + - '.github/workflows/connections_tests.yml' + - 'ci/*.yml' + - 'ci/playbooks/connections/**' + - 'ci/run_connection_test.sh' + - 'plugins/connection/**' + - 'tests/integration/targets/connection/**' + - 'tests/integration/targets/connection_*/**' + schedule: + - cron: 3 0 * * * # Run daily at 0:03 UTC + +jobs: + build-collection-artifact-connection-tests: + name: Build artifact + runs-on: ${{ matrix.runner-os }} + strategy: + matrix: + runner-os: + - ubuntu-16.04 + ansible-version: + - git+https://github.com/ansible/ansible.git@devel + runner-python-version: + - 3.7 + steps: + - name: Check out ${{ github.repository }} on disk + uses: actions/checkout@master + - name: Set up Python ${{ matrix.runner-python-version }} + uses: actions/setup-python@v1 + with: + python-version: ${{ matrix.runner-python-version }} + - name: Set up pip cache + uses: actions/cache@v1 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('tests/sanity/requirements.txt') }}-${{ hashFiles('tests/unit/requirements.txt') }} + restore-keys: | + ${{ runner.os }}-pip- + ${{ runner.os }}- + - name: Install Ansible ${{ matrix.ansible-version }} + run: >- + python -m pip install --user '${{ matrix.ansible-version }}' + - name: Build a collection tarball + run: >- + ~/.local/bin/ansible-galaxy collection build --output-path + "${GITHUB_WORKSPACE}/.cache/collection-tarballs" + - name: Store migrated collection artifacts + uses: actions/upload-artifact@v1 + with: + name: collection + path: .cache/collection-tarballs + + test-podman-connection: + name: Podman connection VM ${{ matrix.os.vm || 'ubuntu-latest' }}-${{ matrix.ansible-version }} + needs: + - build-collection-artifact-connection-tests + runs-on: ${{ matrix.os.vm || 'ubuntu-latest' }} + defaults: + run: + shell: bash + strategy: + fail-fast: false + matrix: + ansible-version: + - ansible<2.10 + - git+https://github.com/ansible/ansible.git@devel + os: + - vm: ubuntu-latest + #- vm: ubuntu-16.04 + #- vm: macos-latest + python-version: + #- 3.8 + - 3.7 + #- 3.6 + #- 3.5 + #- 2.7 + steps: + + - name: Check out repository + uses: actions/checkout@v2 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + + - name: Upgrade pip and display Python and PIP versions + run: | + python -m pip install --upgrade pip + python -V + pip --version + + - name: Set up pip cache + uses: actions/cache@v1 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ github.ref }}-units-VMs + restore-keys: | + ${{ runner.os }}-pip- + ${{ runner.os }}- + + - name: Install Ansible ${{ matrix.ansible-version }} + run: python -m pip install --user '${{ matrix.ansible-version }}' + + - name: Download migrated collection artifacts + uses: actions/download-artifact@v1 + with: + name: collection + path: .cache/collection-tarballs + + - name: Install the collection tarball + run: >- + ~/.local/bin/ansible-galaxy collection install .cache/collection-tarballs/*.tar.gz + + - name: Run collection tests for connection + run: | + export PATH=~/.local/bin:$PATH + + if [[ '${{ matrix.ansible-version }}' == 'git+https://github.com/ansible/ansible.git@devel' ]]; then + export ANSIBLE_CONFIG=$(pwd)/ci/ansible-dev.cfg + elif [[ '${{ matrix.ansible-version }}' == 'ansible<2.10' ]]; then + export ANSIBLE_CONFIG=$(pwd)/ci/ansible-2.9.cfg + fi + + echo $ANSIBLE_CONFIG + command -v ansible-playbook + pip --version + python --version + ansible-playbook --version + + ansible-playbook -vv ci/playbooks/pre.yml \ + -e host=localhost \ + -i localhost, \ + -e ansible_connection=local \ + -e setup_python=false + + ROOT= ./ci/run_connection_test.sh podman + ROOT=true ./ci/run_connection_test.sh podman + shell: bash + + test-buildah-connection: + name: Buildah connection VM ${{ matrix.os.vm || 'ubuntu-latest' }}-${{ matrix.ansible-version }} + needs: + - build-collection-artifact-connection-tests + runs-on: ${{ matrix.os.vm || 'ubuntu-latest' }} + defaults: + run: + shell: bash + strategy: + fail-fast: false + matrix: + ansible-version: + - ansible<2.10 + - git+https://github.com/ansible/ansible.git@devel + os: + - vm: ubuntu-latest + #- vm: ubuntu-16.04 + #- vm: macos-latest + python-version: + #- 3.8 + - 3.7 + #- 3.6 + #- 3.5 + #- 2.7 + steps: + + - name: Check out repository + uses: actions/checkout@v2 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + + - name: Upgrade pip and display Python and PIP versions + run: | + python -m pip install --upgrade pip + python -V + pip --version + + - name: Set up pip cache + uses: actions/cache@v1 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ github.ref }}-units-VMs + restore-keys: | + ${{ runner.os }}-pip- + ${{ runner.os }}- + + - name: Install Ansible ${{ matrix.ansible-version }} + run: python -m pip install --user '${{ matrix.ansible-version }}' + + - name: Download migrated collection artifacts + uses: actions/download-artifact@v1 + with: + name: collection + path: .cache/collection-tarballs + + - name: Install the collection tarball + run: >- + ~/.local/bin/ansible-galaxy collection install .cache/collection-tarballs/*.tar.gz + + - name: Run collection tests for connection + run: | + export PATH=~/.local/bin:$PATH + + if [[ '${{ matrix.ansible-version }}' == 'git+https://github.com/ansible/ansible.git@devel' ]]; then + export ANSIBLE_CONFIG=$(pwd)/ci/ansible-dev.cfg + elif [[ '${{ matrix.ansible-version }}' == 'ansible<2.10' ]]; then + export ANSIBLE_CONFIG=$(pwd)/ci/ansible-2.9.cfg + fi + + echo $ANSIBLE_CONFIG + command -v ansible-playbook + pip --version + python --version + ansible-playbook --version + + ansible-playbook -vv ci/playbooks/pre.yml \ + -e host=localhost \ + -i localhost, \ + -e ansible_connection=local \ + -e setup_python=false + + ROOT= ./ci/run_connection_test.sh buildah + ROOT=true ./ci/run_connection_test.sh buildah + shell: bash diff --git a/.github/workflows/podman_container.yml b/.github/workflows/podman_container.yml new file mode 100644 index 00000000..ba311801 --- /dev/null +++ b/.github/workflows/podman_container.yml @@ -0,0 +1,101 @@ +name: Podman container + +on: + push: + paths: + - '.github/workflows/podman_container.yml' + - 'ci/*.yml' + - 'ci/containers/podman_container.yml' + - 'plugins/modules/podman_container.py' + - 'plugins/modules/podman_container_info.py' + - 'tests/integration/targets/podman_container/**' + branches: + - master + pull_request: + paths: + - '.github/workflows/podman_container.yml' + - 'ci/*.yml' + - 'ci/containers/podman_container.yml' + - 'plugins/modules/podman_container.py' + - 'plugins/modules/podman_container_info.py' + - 'tests/integration/targets/podman_container/**' + schedule: + - cron: 4 0 * * * # Run daily at 0:03 UTC + +jobs: + + test_podman_container: + name: Podman container ${{ matrix.ansible-version }}-${{ matrix.os.vm || 'ubuntu-latest' }} + runs-on: ${{ matrix.os.vm || 'ubuntu-latest' }} + defaults: + run: + shell: bash + strategy: + fail-fast: false + matrix: + ansible-version: + - ansible<2.10 + - git+https://github.com/ansible/ansible.git@devel + os: + - vm: ubuntu-latest + python-version: + - 3.7 + steps: + + - name: Check out repository + uses: actions/checkout@v2 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + + - name: Upgrade pip and display Python and PIP versions + run: | + python -m pip install --upgrade pip + python -V + pip --version + + - name: Set up pip cache + uses: actions/cache@v1 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ github.ref }}-units-VMs + restore-keys: | + ${{ runner.os }}-pip- + ${{ runner.os }}- + + - name: Install Ansible ${{ matrix.ansible-version }} + run: python -m pip install --user '${{ matrix.ansible-version }}' + + - name: Build and install the collection tarball + run: | + rm -rf /tmp/just_new_collection + ~/.local/bin/ansible-galaxy collection build --output-path /tmp/just_new_collection --force + ~/.local/bin/ansible-galaxy collection install -vvv --force /tmp/just_new_collection/*.tar.gz + sudo ~/.local/bin/ansible-galaxy collection install -vvv --force /tmp/just_new_collection/*.tar.gz + + - name: Run collection tests for podman container + run: | + export PATH=~/.local/bin:$PATH + + if [[ '${{ matrix.ansible-version }}' == 'git+https://github.com/ansible/ansible.git@devel' ]]; then + export ANSIBLE_CONFIG=$(pwd)/ci/ansible-dev.cfg + elif [[ '${{ matrix.ansible-version }}' == 'ansible<2.10' ]]; then + export ANSIBLE_CONFIG=$(pwd)/ci/ansible-2.9.cfg + fi + + echo $ANSIBLE_CONFIG + command -v ansible-playbook + pip --version + python --version + ansible-playbook --version + + ansible-playbook -vv ci/playbooks/pre.yml \ + -e host=localhost \ + -i localhost, \ + -e ansible_connection=local \ + -e setup_python=false + + TEST2RUN=podman_container ./ci/run_containers_tests.sh + shell: bash diff --git a/.github/workflows/podman_container_info.yml b/.github/workflows/podman_container_info.yml new file mode 100644 index 00000000..2faa0857 --- /dev/null +++ b/.github/workflows/podman_container_info.yml @@ -0,0 +1,101 @@ +name: Podman container info + +on: + push: + paths: + - '.github/workflows/podman_container_info.yml' + - 'ci/*.yml' + - 'ci/containers/podman_container_info.yml' + - 'plugins/modules/podman_container.py' + - 'plugins/modules/podman_container_info.py' + - 'tests/integration/targets/podman_container_info/**' + branches: + - master + pull_request: + paths: + - '.github/workflows/podman_container_info.yml' + - 'ci/*.yml' + - 'ci/containers/podman_container_info.yml' + - 'plugins/modules/podman_container.py' + - 'plugins/modules/podman_container_info.py' + - 'tests/integration/targets/podman_container_info/**' + schedule: + - cron: 4 0 * * * # Run daily at 0:03 UTC + +jobs: + + test_podman_container_info: + name: Podman container info ${{ matrix.ansible-version }}-${{ matrix.os.vm || 'ubuntu-latest' }} + runs-on: ${{ matrix.os.vm || 'ubuntu-latest' }} + defaults: + run: + shell: bash + strategy: + fail-fast: false + matrix: + ansible-version: + - ansible<2.10 + - git+https://github.com/ansible/ansible.git@devel + os: + - vm: ubuntu-latest + python-version: + - 3.7 + steps: + + - name: Check out repository + uses: actions/checkout@v2 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + + - name: Upgrade pip and display Python and PIP versions + run: | + python -m pip install --upgrade pip + python -V + pip --version + + - name: Set up pip cache + uses: actions/cache@v1 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ github.ref }}-units-VMs + restore-keys: | + ${{ runner.os }}-pip- + ${{ runner.os }}- + + - name: Install Ansible ${{ matrix.ansible-version }} + run: python -m pip install --user '${{ matrix.ansible-version }}' + + - name: Build and install the collection tarball + run: | + rm -rf /tmp/just_new_collection + ~/.local/bin/ansible-galaxy collection build --output-path /tmp/just_new_collection --force + ~/.local/bin/ansible-galaxy collection install -vvv --force /tmp/just_new_collection/*.tar.gz + sudo ~/.local/bin/ansible-galaxy collection install -vvv --force /tmp/just_new_collection/*.tar.gz + + - name: Run collection tests for podman container info + run: | + export PATH=~/.local/bin:$PATH + + if [[ '${{ matrix.ansible-version }}' == 'git+https://github.com/ansible/ansible.git@devel' ]]; then + export ANSIBLE_CONFIG=$(pwd)/ci/ansible-dev.cfg + elif [[ '${{ matrix.ansible-version }}' == 'ansible<2.10' ]]; then + export ANSIBLE_CONFIG=$(pwd)/ci/ansible-2.9.cfg + fi + + echo $ANSIBLE_CONFIG + command -v ansible-playbook + pip --version + python --version + ansible-playbook --version + + ansible-playbook -vv ci/playbooks/pre.yml \ + -e host=localhost \ + -i localhost, \ + -e ansible_connection=local \ + -e setup_python=false + + TEST2RUN=podman_container_info ./ci/run_containers_tests.sh + shell: bash diff --git a/.github/workflows/podman_image.yml b/.github/workflows/podman_image.yml new file mode 100644 index 00000000..c91b442a --- /dev/null +++ b/.github/workflows/podman_image.yml @@ -0,0 +1,101 @@ +name: Podman image + +on: + push: + paths: + - '.github/workflows/podman_image.yml' + - 'ci/*.yml' + - 'ci/containers/podman_image.yml' + - 'plugins/modules/podman_image.py' + - 'plugins/modules/podman_image_info.py' + - 'tests/integration/targets/podman_image/**' + branches: + - master + pull_request: + paths: + - '.github/workflows/podman_image.yml' + - 'ci/*.yml' + - 'ci/containers/podman_image.yml' + - 'plugins/modules/podman_image.py' + - 'plugins/modules/podman_image_info.py' + - 'tests/integration/targets/podman_image/**' + schedule: + - cron: 4 0 * * * # Run daily at 0:03 UTC + +jobs: + + test_podman_image: + name: Podman image ${{ matrix.ansible-version }}-${{ matrix.os.vm || 'ubuntu-latest' }} + runs-on: ${{ matrix.os.vm || 'ubuntu-latest' }} + defaults: + run: + shell: bash + strategy: + fail-fast: false + matrix: + ansible-version: + - ansible<2.10 + - git+https://github.com/ansible/ansible.git@devel + os: + - vm: ubuntu-latest + python-version: + - 3.7 + steps: + + - name: Check out repository + uses: actions/checkout@v2 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + + - name: Upgrade pip and display Python and PIP versions + run: | + python -m pip install --upgrade pip + python -V + pip --version + + - name: Set up pip cache + uses: actions/cache@v1 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ github.ref }}-units-VMs + restore-keys: | + ${{ runner.os }}-pip- + ${{ runner.os }}- + + - name: Install Ansible ${{ matrix.ansible-version }} + run: python -m pip install --user '${{ matrix.ansible-version }}' + + - name: Build and install the collection tarball + run: | + rm -rf /tmp/just_new_collection + ~/.local/bin/ansible-galaxy collection build --output-path /tmp/just_new_collection --force + ~/.local/bin/ansible-galaxy collection install -vvv --force /tmp/just_new_collection/*.tar.gz + sudo ~/.local/bin/ansible-galaxy collection install -vvv --force /tmp/just_new_collection/*.tar.gz + + - name: Run collection tests for podman image + run: | + export PATH=~/.local/bin:$PATH + + if [[ '${{ matrix.ansible-version }}' == 'git+https://github.com/ansible/ansible.git@devel' ]]; then + export ANSIBLE_CONFIG=$(pwd)/ci/ansible-dev.cfg + elif [[ '${{ matrix.ansible-version }}' == 'ansible<2.10' ]]; then + export ANSIBLE_CONFIG=$(pwd)/ci/ansible-2.9.cfg + fi + + echo $ANSIBLE_CONFIG + command -v ansible-playbook + pip --version + python --version + ansible-playbook --version + + ansible-playbook -vv ci/playbooks/pre.yml \ + -e host=localhost \ + -i localhost, \ + -e ansible_connection=local \ + -e setup_python=false + + TEST2RUN=podman_image ./ci/run_containers_tests.sh + shell: bash diff --git a/.github/workflows/podman_image_info.yml b/.github/workflows/podman_image_info.yml new file mode 100644 index 00000000..b063c4b1 --- /dev/null +++ b/.github/workflows/podman_image_info.yml @@ -0,0 +1,101 @@ +name: Podman image info + +on: + push: + paths: + - '.github/workflows/podman_image_info.yml' + - 'ci/*.yml' + - 'ci/containers/podman_image_info.yml' + - 'plugins/modules/podman_image.py' + - 'plugins/modules/podman_image_info.py' + - 'tests/integration/targets/podman_image_info/**' + branches: + - master + pull_request: + paths: + - '.github/workflows/podman_image_info.yml' + - 'ci/*.yml' + - 'ci/containers/podman_image_info.yml' + - 'plugins/modules/podman_image.py' + - 'plugins/modules/podman_image_info.py' + - 'tests/integration/targets/podman_image_info/**' + schedule: + - cron: 4 0 * * * # Run daily at 0:03 UTC + +jobs: + + test_podman_image_info: + name: Podman image info ${{ matrix.ansible-version }}-${{ matrix.os.vm || 'ubuntu-latest' }} + runs-on: ${{ matrix.os.vm || 'ubuntu-latest' }} + defaults: + run: + shell: bash + strategy: + fail-fast: false + matrix: + ansible-version: + - ansible<2.10 + - git+https://github.com/ansible/ansible.git@devel + os: + - vm: ubuntu-latest + python-version: + - 3.7 + steps: + + - name: Check out repository + uses: actions/checkout@v2 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + + - name: Upgrade pip and display Python and PIP versions + run: | + python -m pip install --upgrade pip + python -V + pip --version + + - name: Set up pip cache + uses: actions/cache@v1 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ github.ref }}-units-VMs + restore-keys: | + ${{ runner.os }}-pip- + ${{ runner.os }}- + + - name: Install Ansible ${{ matrix.ansible-version }} + run: python -m pip install --user '${{ matrix.ansible-version }}' + + - name: Build and install the collection tarball + run: | + rm -rf /tmp/just_new_collection + ~/.local/bin/ansible-galaxy collection build --output-path /tmp/just_new_collection --force + ~/.local/bin/ansible-galaxy collection install -vvv --force /tmp/just_new_collection/*.tar.gz + sudo ~/.local/bin/ansible-galaxy collection install -vvv --force /tmp/just_new_collection/*.tar.gz + + - name: Run collection tests for podman image info + run: | + export PATH=~/.local/bin:$PATH + + if [[ '${{ matrix.ansible-version }}' == 'git+https://github.com/ansible/ansible.git@devel' ]]; then + export ANSIBLE_CONFIG=$(pwd)/ci/ansible-dev.cfg + elif [[ '${{ matrix.ansible-version }}' == 'ansible<2.10' ]]; then + export ANSIBLE_CONFIG=$(pwd)/ci/ansible-2.9.cfg + fi + + echo $ANSIBLE_CONFIG + command -v ansible-playbook + pip --version + python --version + ansible-playbook --version + + ansible-playbook -vv ci/playbooks/pre.yml \ + -e host=localhost \ + -i localhost, \ + -e ansible_connection=local \ + -e setup_python=false + + TEST2RUN=podman_image_info ./ci/run_containers_tests.sh + shell: bash diff --git a/.github/workflows/podman_network_info.yml b/.github/workflows/podman_network_info.yml new file mode 100644 index 00000000..82a766d8 --- /dev/null +++ b/.github/workflows/podman_network_info.yml @@ -0,0 +1,99 @@ +name: Podman network info + +on: + push: + paths: + - '.github/workflows/podman_network_info.yml' + - 'ci/*.yml' + - 'ci/containers/podman_network_info.yml' + - 'plugins/modules/podman_network_info.py' + - 'tests/integration/targets/podman_network_info/**' + branches: + - master + pull_request: + paths: + - '.github/workflows/podman_network_info.yml' + - 'ci/*.yml' + - 'ci/containers/podman_network_info.yml' + - 'plugins/modules/podman_network_info.py' + - 'tests/integration/targets/podman_network_info/**' + schedule: + - cron: 4 0 * * * # Run daily at 0:03 UTC + +jobs: + + test_podman_network_info: + name: Podman network info ${{ matrix.ansible-version }}-${{ matrix.os.vm || 'ubuntu-latest' }} + runs-on: ${{ matrix.os.vm || 'ubuntu-latest' }} + defaults: + run: + shell: bash + strategy: + fail-fast: false + matrix: + ansible-version: + - ansible<2.10 + - git+https://github.com/ansible/ansible.git@devel + os: + - vm: ubuntu-latest + python-version: + - 3.7 + steps: + + - name: Check out repository + uses: actions/checkout@v2 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + + - name: Upgrade pip and display Python and PIP versions + run: | + python -m pip install --upgrade pip + python -V + pip --version + + - name: Set up pip cache + uses: actions/cache@v1 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ github.ref }}-units-VMs + restore-keys: | + ${{ runner.os }}-pip- + ${{ runner.os }}- + + - name: Install Ansible ${{ matrix.ansible-version }} + run: python -m pip install --user '${{ matrix.ansible-version }}' + + - name: Build and install the collection tarball + run: | + rm -rf /tmp/just_new_collection + ~/.local/bin/ansible-galaxy collection build --output-path /tmp/just_new_collection --force + ~/.local/bin/ansible-galaxy collection install -vvv --force /tmp/just_new_collection/*.tar.gz + sudo ~/.local/bin/ansible-galaxy collection install -vvv --force /tmp/just_new_collection/*.tar.gz + + - name: Run collection tests for podman network info + run: | + export PATH=~/.local/bin:$PATH + + if [[ '${{ matrix.ansible-version }}' == 'git+https://github.com/ansible/ansible.git@devel' ]]; then + export ANSIBLE_CONFIG=$(pwd)/ci/ansible-dev.cfg + elif [[ '${{ matrix.ansible-version }}' == 'ansible<2.10' ]]; then + export ANSIBLE_CONFIG=$(pwd)/ci/ansible-2.9.cfg + fi + + echo $ANSIBLE_CONFIG + command -v ansible-playbook + pip --version + python --version + ansible-playbook --version + + ansible-playbook -vv ci/playbooks/pre.yml \ + -e host=localhost \ + -i localhost, \ + -e ansible_connection=local \ + -e setup_python=false + + TEST2RUN=podman_network_info ./ci/run_containers_tests.sh + shell: bash diff --git a/.github/workflows/podman_volume_info.yml b/.github/workflows/podman_volume_info.yml new file mode 100644 index 00000000..b64b63ff --- /dev/null +++ b/.github/workflows/podman_volume_info.yml @@ -0,0 +1,99 @@ +name: Podman volume info + +on: + push: + paths: + - '.github/workflows/podman_volume_info.yml' + - 'ci/*.yml' + - 'ci/containers/podman_volume_info.yml' + - 'plugins/modules/podman_volume_info.py' + - 'tests/integration/targets/podman_volume_info/**' + branches: + - master + pull_request: + paths: + - '.github/workflows/podman_volume_info.yml' + - 'ci/*.yml' + - 'ci/containers/podman_volume_info.yml' + - 'plugins/modules/podman_volume_info.py' + - 'tests/integration/targets/podman_volume_info/**' + schedule: + - cron: 4 0 * * * # Run daily at 0:03 UTC + +jobs: + + test_podman_volume_info: + name: Podman volume info ${{ matrix.ansible-version }}-${{ matrix.os.vm || 'ubuntu-latest' }} + runs-on: ${{ matrix.os.vm || 'ubuntu-latest' }} + defaults: + run: + shell: bash + strategy: + fail-fast: false + matrix: + ansible-version: + - ansible<2.10 + - git+https://github.com/ansible/ansible.git@devel + os: + - vm: ubuntu-latest + python-version: + - 3.7 + steps: + + - name: Check out repository + uses: actions/checkout@v2 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + + - name: Upgrade pip and display Python and PIP versions + run: | + python -m pip install --upgrade pip + python -V + pip --version + + - name: Set up pip cache + uses: actions/cache@v1 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ github.ref }}-units-VMs + restore-keys: | + ${{ runner.os }}-pip- + ${{ runner.os }}- + + - name: Install Ansible ${{ matrix.ansible-version }} + run: python -m pip install --user '${{ matrix.ansible-version }}' + + - name: Build and install the collection tarball + run: | + rm -rf /tmp/just_new_collection + ~/.local/bin/ansible-galaxy collection build --output-path /tmp/just_new_collection --force + ~/.local/bin/ansible-galaxy collection install -vvv --force /tmp/just_new_collection/*.tar.gz + sudo ~/.local/bin/ansible-galaxy collection install -vvv --force /tmp/just_new_collection/*.tar.gz + + - name: Run collection tests for podman volume info + run: | + export PATH=~/.local/bin:$PATH + + if [[ '${{ matrix.ansible-version }}' == 'git+https://github.com/ansible/ansible.git@devel' ]]; then + export ANSIBLE_CONFIG=$(pwd)/ci/ansible-dev.cfg + elif [[ '${{ matrix.ansible-version }}' == 'ansible<2.10' ]]; then + export ANSIBLE_CONFIG=$(pwd)/ci/ansible-2.9.cfg + fi + + echo $ANSIBLE_CONFIG + command -v ansible-playbook + pip --version + python --version + ansible-playbook --version + + ansible-playbook -vv ci/playbooks/pre.yml \ + -e host=localhost \ + -i localhost, \ + -e ansible_connection=local \ + -e setup_python=false + + TEST2RUN=podman_volume_info ./ci/run_containers_tests.sh + shell: bash