Cancel outades pipeline runs #1363
This file contains hidden or 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: Test Collection Roles | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| logLevel: | |
| description: 'Log level' | |
| required: true | |
| default: 'warning' | |
| type: choice | |
| options: | |
| - info | |
| - warning | |
| - debug | |
| pull_request: | |
| paths: | |
| - 'roles/**' | |
| - 'molecule/elasticstack_default/**' | |
| - 'requirements-test.txt' | |
| - '.yamllint' | |
| - '.config/ansible-lint.yml' | |
| - 'galaxy.yml' | |
| - '.github/workflows/test_roles_pr.yml' | |
| merge_group: | |
| # Cancel outdated pipeline runs when a new push occurs in the pull request and a new pipeline starts. | |
| # The merge queue is not affected because each merge attempt uses a new temporary branch with a unique name, | |
| # so github.ref is different each time. | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| lint_collection: | |
| if: github.event.pull_request.draft == false | |
| uses: ./.github/workflows/test_linting.yml | |
| with: | |
| rolename: '' | |
| molecule_core_2_19: | |
| runs-on: ubuntu-latest | |
| needs: lint_collection | |
| env: | |
| COLLECTION_NAMESPACE: netways | |
| COLLECTION_NAME: elasticstack | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| distro: | |
| - rockylinux9 | |
| - ubuntu2204 | |
| scenario: | |
| - elasticstack_default | |
| release: | |
| - 8 | |
| python_version: | |
| - "3.11" | |
| ansible_version: | |
| - "ansible-core>=2.19,<2.20" #Correspond ansible>=12.0,<13.0 | |
| steps: | |
| - name: Check out code | |
| uses: actions/checkout@v6 | |
| - name: Set up Python ${{ matrix.python_version }} | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python_version }} | |
| - name: Install dependencies | |
| run: | | |
| python3 -m pip install --upgrade pip | |
| python3 -m pip install "${{ matrix.ansible_version }}" | |
| python3 -m pip install -r requirements-test.txt | |
| - name: Install collection | |
| run: | | |
| mkdir -p ~/.ansible/collections/ansible_collections/$COLLECTION_NAMESPACE | |
| cp -a ../ansible-collection-$COLLECTION_NAME ~/.ansible/collections/ansible_collections/$COLLECTION_NAMESPACE/$COLLECTION_NAME | |
| - name: Test with molecule | |
| run: | | |
| ansible --version | |
| molecule --version | |
| molecule test -s ${{ matrix.scenario }} | |
| env: | |
| MOLECULE_DISTRO: ${{ matrix.distro }} | |
| PY_COLORS: '1' | |
| ANSIBLE_FORCE_COLOR: '1' | |
| ELASTIC_RELEASE: ${{ matrix.release }} | |
| molecule_core_2_20: | |
| runs-on: ubuntu-latest | |
| needs: lint_collection | |
| env: | |
| COLLECTION_NAMESPACE: netways | |
| COLLECTION_NAME: elasticstack | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| distro: | |
| - rockylinux9 | |
| - ubuntu2204 | |
| scenario: | |
| - elasticstack_default | |
| release: | |
| - 8 | |
| python_version: | |
| - "3.14" | |
| ansible_version: | |
| - "ansible-core>=2.20,<2.21" #Correspond ansible>=13.0,<14.0 | |
| steps: | |
| - name: Check out code | |
| uses: actions/checkout@v6 | |
| - name: Set up Python ${{ matrix.python_version }} | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python_version }} | |
| - name: Install dependencies | |
| run: | | |
| python3 -m pip install --upgrade pip | |
| python3 -m pip install "${{ matrix.ansible_version }}" | |
| python3 -m pip install -r requirements-test.txt | |
| - name: Install collection | |
| run: | | |
| mkdir -p ~/.ansible/collections/ansible_collections/$COLLECTION_NAMESPACE | |
| cp -a ../ansible-collection-$COLLECTION_NAME ~/.ansible/collections/ansible_collections/$COLLECTION_NAMESPACE/$COLLECTION_NAME | |
| - name: Test with molecule | |
| run: | | |
| ansible --version | |
| molecule --version | |
| molecule test -s ${{ matrix.scenario }} | |
| env: | |
| MOLECULE_DISTRO: ${{ matrix.distro }} | |
| PY_COLORS: '1' | |
| ANSIBLE_FORCE_COLOR: '1' | |
| ELASTIC_RELEASE: ${{ matrix.release }} |