Skip to content

Commit

Permalink
[ci/debug] Debug docker on github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
nemesifier committed May 22, 2024
1 parent 7bc4790 commit fa3aa64
Showing 1 changed file with 56 additions and 39 deletions.
95 changes: 56 additions & 39 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit fa3aa64

Please sign in to comment.