Skip to content

fix(test_config.py): ensure /etc/atomic.conf exists before bind-mount #125

fix(test_config.py): ensure /etc/atomic.conf exists before bind-mount

fix(test_config.py): ensure /etc/atomic.conf exists before bind-mount #125

Workflow file for this run

name: CI
on:
push:
paths:
- 'bin/**'
- 'lib/**'
- 'extras/**'
- 'tests/*.sh'
- 'tests/*.py'
- '.github/workflows/ci.yml'
pull_request:
paths:
- 'bin/**'
- 'lib/**'
- 'extras/**'
- 'tests/*.sh'
- 'tests/*.py'
- '.github/workflows/ci.yml'
jobs:
changes:
runs-on: ubuntu-latest
permissions:
pull-requests: read
outputs:
shell: ${{ steps.filter.outputs.shell }}
python: ${{ steps.filter.outputs.python }}
integration: ${{ steps.filter.outputs.integration }}
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: dorny/paths-filter@v4
id: filter
with:
filters: |
shell:
- 'bin/**'
- 'lib/atomic/common.sh'
- 'extras/pacman-wrapper'
- 'tests/test_harness.sh'
- 'tests/test_validate.sh'
- 'tests/test_device.sh'
- 'tests/test_space.sh'
- 'tests/test_chroot.sh'
- 'tests/test_gc.sh'
- 'tests/test_uki.sh'
- 'tests/test_home.sh'
- 'tests/test_upgrade.sh'
- 'tests/test_rebuild_uki.sh'
- '.github/workflows/ci.yml'
python:
- 'lib/atomic/config.py'
- 'lib/atomic/fstab.py'
- 'lib/atomic/rootdev.py'
- 'tests/test_config.py'
- 'tests/test_fstab.py'
- 'tests/test_rootdev.py'
- '.github/workflows/ci.yml'
integration:
- 'bin/atomic-guard'
- 'extras/pacman-wrapper'
- 'lib/atomic/common.sh'
- 'etc/atomic.conf'
- 'tests/test_integration.sh'
- '.github/workflows/ci.yml'
shellcheck:
needs: changes
if: needs.changes.outputs.shell == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- run: |
shellcheck -s bash -e SC1090,SC1091,SC2010,SC2034 \
bin/atomic-upgrade \
bin/atomic-gc \
bin/atomic-rebuild-uki \
lib/atomic/common.sh \
extras/pacman-wrapper
shellcheck -s bash -e SC1090,SC1091,SC2310 \
bin/atomic-guard
python-lint:
needs: changes
if: needs.changes.outputs.python == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- run: pip install --no-cache-dir ruff mypy
- run: ruff check lib/atomic/config.py lib/atomic/fstab.py lib/atomic/rootdev.py
- run: mypy --ignore-missing-imports lib/atomic/config.py lib/atomic/fstab.py lib/atomic/rootdev.py
python-test:
needs: changes
if: needs.changes.outputs.python == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- run: pip install --no-cache-dir pytest
- run: python -m pytest tests/ -v
python-test-root:
needs: changes
if: needs.changes.outputs.python == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- run: sudo pip install --no-cache-dir pytest
- run: sudo python -m pytest tests/test_config.py::TestParseConfig::test_config_not_owned_by_root -v
bash-test:
needs: changes
if: needs.changes.outputs.shell == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- run: |
for t in \
tests/test_validate.sh \
tests/test_device.sh \
tests/test_space.sh \
tests/test_chroot.sh \
tests/test_gc.sh \
tests/test_uki.sh \
tests/test_home.sh \
tests/test_upgrade.sh \
tests/test_rebuild_uki.sh; do
echo "━━━ $t ━━━"
bash "$t" || exit 1
done
integration-test:
needs: changes
if: needs.changes.outputs.integration == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- run: bash tests/test_integration.sh