CI #340
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: CI | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| schedule: | |
| - cron: "0 5 * * 0" | |
| defaults: | |
| run: | |
| working-directory: "ansible_collections/gmazoyer/peering_manager" | |
| jobs: | |
| lint: | |
| name: lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| path: "ansible_collections/gmazoyer/peering_manager" | |
| - name: Setup Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.x" | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip wheel | |
| pip3 install ansible ansible-lint | |
| - name: Lint code | |
| run: ansible-lint -p . | |
| molecule: | |
| name: molecule | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| distro: | |
| - debian12 | |
| - debian13 | |
| - ubuntu2204 | |
| - ubuntu2404 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| path: "ansible_collections/gmazoyer/peering_manager" | |
| - name: Setup Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.x" | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip wheel | |
| pip3 install ansible molecule molecule-plugins[docker] docker | |
| - name: Run Molecule | |
| run: molecule test | |
| env: | |
| PY_COLORS: "1" | |
| ANSIBLE_FORCE_COLOR: "1" | |
| MOLECULE_DISTRO: ${{ matrix.distro }} | |
| galaxy: | |
| name: galaxy publish | |
| runs-on: ubuntu-latest | |
| needs: [lint, molecule] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| path: "ansible_collections/gmazoyer/peering_manager" | |
| - name: Setup Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.x" | |
| - name: Install Ansible | |
| run: | | |
| python -m pip install --upgrade pip wheel | |
| pip3 install ansible | |
| - name: Build collection | |
| run: ansible-galaxy collection build | |
| - name: Publish collection | |
| run: >- | |
| ansible-galaxy collection publish | |
| --token ${{ secrets.GALAXY_API_KEY }} | |
| gmazoyer-peering_manager-*.tar.gz |