diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a58b075a..9ad8b1bc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,51 +13,68 @@ on: # yamllint disable-line rule:truthy - dev jobs: - build: - name: Build ${{ matrix.distro }} - runs-on: ubuntu-20.04 - - strategy: - fail-fast: false - matrix: - distro: - - ubuntu2004 - - ubuntu2204 - - debian11 + increase-verbosity: - steps: - - uses: actions/checkout@v2 - with: - ref: ${{ github.event.pull_request.head.sha }} + build: + name: Build ${{ matrix.distro }} + runs-on: ubuntu-20.04 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: - python-version: "3.x" + strategy: + fail-fast: false + matrix: + distro: + - ubuntu2004 + - ubuntu2204 + - debian11 - - name: Install python dependencies - run: | - pip install molecule molecule-plugins[docker] yamllint ansible-lint docker - pip install openwisp-utils[qa] + steps: + - name: Check Docker Version + run: docker --version - - name: Install Ansible Galaxy dependencies - run: ansible-galaxy collection install "community.general:>=3.6.0" + - name: Check Docker Info + run: docker info - - name: QA checks - run: | - openwisp-qa-check --skip-isort --skip-flake8 --skip-checkmigrations --skip-black + - name: Enable Debug Output + run: | + sudo mkdir -p /etc/systemd/system/docker.service.d + echo '[Service]' | sudo tee /etc/systemd/system/docker.service.d/override.conf + echo 'Environment="DOCKER_OPTS=--debug"' | sudo tee -a /etc/systemd/system/docker.service.d/override.conf + sudo systemctl daemon-reload + sudo systemctl restart docker + sudo journalctl -u docker.service --no-pager --since "5 minutes ago" - - name: Tests - run: | - mkdir -p ~/.ansible/roles - ln -s $GITHUB_WORKSPACE ~/.ansible/roles/openwisp.openwisp2 - molecule test - env: - ROLE_NAME: openwisp2 - PY_COLORS: '1' - ANSIBLE_FORCE_COLOR: '1' - MOLECULE_DISTRO: ${{ matrix.distro }} - ANSIBLE_ROLES_PATH: /home/runner/.cache/molecule/ansible-openwisp2/default/roles:/home/runner/.ansible/roles:/usr/share/ansible/roles:/etc/ansible/roles + - uses: actions/checkout@v2 + with: + ref: ${{ github.event.pull_request.head.sha }} + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: "3.x" + + - name: Install python dependencies + run: | + pip install molecule molecule-plugins[docker] yamllint ansible-lint docker + pip install openwisp-utils[qa] + + - name: Install Ansible Galaxy dependencies + run: ansible-galaxy collection install "community.general:>=3.6.0" + + - name: QA checks + run: | + openwisp-qa-check --skip-isort --skip-flake8 --skip-checkmigrations --skip-black + + - name: Tests + run: | + mkdir -p ~/.ansible/roles + ln -s $GITHUB_WORKSPACE ~/.ansible/roles/openwisp.openwisp2 + molecule test + env: + ROLE_NAME: openwisp2 + PY_COLORS: '1' + ANSIBLE_FORCE_COLOR: '1' + MOLECULE_DISTRO: ${{ matrix.distro }} + ANSIBLE_ROLES_PATH: /home/runner/.cache/molecule/ansible-openwisp2/default/roles:/home/runner/.ansible/roles:/usr/share/ansible/roles:/etc/ansible/roles import: name: Update imports on Ansible Galaxy