Merge pull request #35 from compscidr/renovate/major-github-artifact-… #28
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: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| lint: | |
| name: Ansible Lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Run ansible-lint | |
| uses: ansible/ansible-lint@main | |
| with: | |
| args: "" | |
| setup_python: "true" | |
| working_directory: "" | |
| requirements_file: "" | |
| molecule: | |
| name: Molecule Test | |
| needs: lint | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| scenario: | |
| - default | |
| - java-runner | |
| - android-runner | |
| - org-runner | |
| fail-fast: false | |
| max-parallel: 1 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.11' | |
| - name: Cache pip packages | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/pip | |
| key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pip- | |
| - name: Free up disk space | |
| run: | | |
| echo "Disk space before cleanup:" | |
| df -h | |
| sudo rm -rf /usr/share/dotnet | |
| sudo rm -rf /opt/ghc | |
| sudo rm -rf /usr/local/share/boost | |
| sudo rm -rf "$AGENT_TOOLSDIRECTORY" | |
| sudo docker system prune -af --volumes | |
| echo "Disk space after cleanup:" | |
| df -h | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| - name: Install Ansible Galaxy dependencies | |
| run: | | |
| ansible-galaxy collection install -r requirements.yml | |
| - name: Run Molecule tests | |
| run: | | |
| molecule test --scenario-name ${{ matrix.scenario }} | |
| env: | |
| PY_COLORS: '1' | |
| ANSIBLE_FORCE_COLOR: '1' | |
| - name: Clean up Docker after test | |
| if: always() | |
| run: | | |
| docker system prune -af --volumes | |
| echo "Disk space after test cleanup:" | |
| df -h | |
| - name: Upload molecule logs on failure | |
| if: failure() | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: molecule-logs-${{ matrix.scenario }} | |
| path: | | |
| molecule/${{ matrix.scenario }}/.molecule/ | |
| ~/.cache/molecule/ |