|
| 1 | +# SPDX-FileCopyrightText: 2022 Helmholtz Centre for Environmental Research (UFZ) |
| 2 | +# SPDX-FileCopyrightText: 2022 Helmholtz-Zentrum Dresden-Rossendorf (HZDR) |
| 3 | +# |
| 4 | +# SPDX-License-Identifier: Apache-2.0 |
| 5 | + |
| 6 | +--- |
| 7 | +name: CI |
| 8 | +on: |
| 9 | + pull_request: |
| 10 | + push: |
| 11 | + branches: |
| 12 | + - "main" |
| 13 | + tags: |
| 14 | + - "v*.*.*" |
| 15 | + schedule: |
| 16 | + - cron: '0 2 * * *' |
| 17 | + |
| 18 | +env: |
| 19 | + PY_COLORS: 1 |
| 20 | + ANSIBLE_FORCE_COLOR: 1 |
| 21 | + |
| 22 | +jobs: |
| 23 | + |
| 24 | + lint: |
| 25 | + name: Lint |
| 26 | + runs-on: ubuntu-latest |
| 27 | + steps: |
| 28 | + - name: Check out the codebase. |
| 29 | + uses: actions/checkout@v3 |
| 30 | + |
| 31 | + - name: Prepare the job environment. |
| 32 | + uses: ./.github/workflows/prepare-action |
| 33 | + |
| 34 | + - name: Lint code. |
| 35 | + run: pipenv run molecule lint |
| 36 | + |
| 37 | + license_compliance: |
| 38 | + name: Check license compliance with reuse. |
| 39 | + runs-on: ubuntu-latest |
| 40 | + steps: |
| 41 | + - name: Check out the codebase. |
| 42 | + uses: actions/checkout@v3 |
| 43 | + |
| 44 | + - name: Prepare the job environment. |
| 45 | + uses: ./.github/workflows/prepare-action |
| 46 | + |
| 47 | + - name: Lint code. |
| 48 | + run: pipenv run reuse lint |
| 49 | + |
| 50 | + test: |
| 51 | + name: Run Molecule tests. |
| 52 | + runs-on: ubuntu-latest |
| 53 | + |
| 54 | + steps: |
| 55 | + - name: Check out the codebase. |
| 56 | + uses: actions/checkout@v3 |
| 57 | + |
| 58 | + - name: Prepare the job environment. |
| 59 | + uses: ./.github/workflows/prepare-action |
| 60 | + |
| 61 | + - name: Run Molecule tests. |
| 62 | + run: pipenv run molecule test |
| 63 | + |
| 64 | + release: |
| 65 | + name: Release new version on Ansible Galaxy |
| 66 | + runs-on: ubuntu-latest |
| 67 | + if: startsWith(github.ref, 'refs/tags/v') |
| 68 | + needs: [lint, license_compliance, test] |
| 69 | + steps: |
| 70 | + - name: checkout |
| 71 | + uses: actions/checkout@v3 |
| 72 | + - name: galaxy |
| 73 | + uses: robertdebock/galaxy-action@1.2.0 |
| 74 | + with: |
| 75 | + galaxy_api_key: ${{ secrets.galaxy_api_key }} |
| 76 | + git_branch: "main" |
0 commit comments