|
| 1 | +name: Collection integration |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - master |
| 7 | + pull_request: |
| 8 | + # schedule: |
| 9 | + # - cron: 3 0 * * * # Run daily at 0:03 UTC |
| 10 | + |
| 11 | +jobs: |
| 12 | + build-collection-artifact: |
| 13 | + name: Build collection |
| 14 | + runs-on: ${{ matrix.runner-os }} |
| 15 | + strategy: |
| 16 | + matrix: |
| 17 | + runner-os: |
| 18 | + - ubuntu-latest |
| 19 | + ansible-version: |
| 20 | + - git+https://github.com/ansible/ansible.git@devel |
| 21 | + runner-python-version: |
| 22 | + - 3.8 |
| 23 | + steps: |
| 24 | + - uses: actions/checkout@v1 |
| 25 | + - name: Set up Python ${{ matrix.runner-python-version }} |
| 26 | + uses: actions/setup-python@v1 |
| 27 | + with: |
| 28 | + python-version: ${{ matrix.runner-python-version }} |
| 29 | + - name: Set up pip cache |
| 30 | + uses: actions/cache@v1 |
| 31 | + with: |
| 32 | + path: ~/.cache/pip |
| 33 | + key: ${{ runner.os }}-pip-${{ github.ref }} |
| 34 | + - name: Install Ansible ${{ matrix.ansible-version }} |
| 35 | + run: >- |
| 36 | + python -m |
| 37 | + pip |
| 38 | + install |
| 39 | + --user |
| 40 | + ${{ matrix.ansible-version }} |
| 41 | + - name: Build a collection tarball |
| 42 | + run: >- |
| 43 | + ~/.local/bin/ansible-galaxy |
| 44 | + collection |
| 45 | + build |
| 46 | + --output-path |
| 47 | + "${GITHUB_WORKSPACE}/.cache/collection-tarballs" |
| 48 | + - name: Store migrated collection artifacts |
| 49 | + uses: actions/upload-artifact@v1 |
| 50 | + with: |
| 51 | + name: >- |
| 52 | + collection |
| 53 | + path: .cache/collection-tarballs |
| 54 | + |
| 55 | + sanity-test-collection-via-containers: |
| 56 | + name: Sanity in container via Python ${{ matrix.python-version }} |
| 57 | + needs: |
| 58 | + - build-collection-artifact |
| 59 | + runs-on: ${{ matrix.runner-os }} |
| 60 | + strategy: |
| 61 | + fail-fast: false |
| 62 | + matrix: |
| 63 | + runner-os: |
| 64 | + - ubuntu-latest |
| 65 | + runner-python-version: |
| 66 | + - 3.6 |
| 67 | + ansible-version: |
| 68 | + - git+https://github.com/ansible/ansible.git@devel |
| 69 | + steps: |
| 70 | + - name: Set up Python ${{ matrix.runner-python-version }} |
| 71 | + uses: actions/setup-python@v1 |
| 72 | + with: |
| 73 | + python-version: ${{ matrix.runner-python-version }} |
| 74 | + - name: Set up pip cache |
| 75 | + uses: actions/cache@v1 |
| 76 | + with: |
| 77 | + path: ~/.cache/pip |
| 78 | + key: ${{ runner.os }}-pip-${{ github.ref }}-sanity-containers |
| 79 | + restore-keys: | |
| 80 | + ${{ runner.os }}-pip- |
| 81 | + ${{ runner.os }}- |
| 82 | + - name: Install Ansible ${{ matrix.ansible-version }} |
| 83 | + run: >- |
| 84 | + python -m |
| 85 | + pip |
| 86 | + install |
| 87 | + --user |
| 88 | + ${{ matrix.ansible-version }} |
| 89 | + - name: Download migrated collection artifacts |
| 90 | + uses: actions/download-artifact@v1 |
| 91 | + with: |
| 92 | + name: >- |
| 93 | + collection |
| 94 | + path: .cache/collection-tarballs |
| 95 | + - name: Install the collection tarball |
| 96 | + run: >- |
| 97 | + ~/.local/bin/ansible-galaxy |
| 98 | + collection |
| 99 | + install |
| 100 | + .cache/collection-tarballs/*.tar.gz |
| 101 | + - name: Run collection sanity tests |
| 102 | + run: >- |
| 103 | + ~/.local/bin/ansible-test |
| 104 | + sanity |
| 105 | + --color |
| 106 | + --requirements |
| 107 | + --docker |
| 108 | + -vvv |
| 109 | + working-directory: >- |
| 110 | + /home/runner/.ansible/collections/ansible_collections/ngine_io/pingping |
0 commit comments