Skip to content

Commit 3f533aa

Browse files
authored
MANIFEST.in checking CI (infra) (#2401)
* Update MANIFEST to also explicitly exclude unecessary files Minor: Add LICENSE and CHANGELOG to sdist * Update MANIFEST.in to also explicitly exclude unnecessary files * Add CI to verify MANIFEST.in
1 parent 03de255 commit 3f533aa

3 files changed

Lines changed: 91 additions & 0 deletions

File tree

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: Verify MANIFEST.in is up to date
2+
permissions:
3+
contents: read
4+
on:
5+
push:
6+
paths:
7+
- checkbox-ng/**
8+
- checkbox-support/**
9+
- .github/workflows/verify-manifest.yaml
10+
pull_request:
11+
paths:
12+
- checkbox-ng/**
13+
- checkbox-support/**
14+
- .github/workflows/verify-manifest.yaml
15+
workflow_dispatch:
16+
17+
jobs:
18+
get_path_matrix:
19+
runs-on: ubuntu-latest
20+
outputs:
21+
path: ${{ steps.paths.outputs.paths }}
22+
steps:
23+
- name: Checkout Checkbox monorepo
24+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
25+
with:
26+
persist-credentials: false
27+
fetch-depth: 0
28+
- name: Fetch all modified paths
29+
id: paths
30+
run: |
31+
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
32+
if [ "$CURRENT_BRANCH" == "main" ]; then
33+
echo "Workflow triggered on main, diffing with HEAD~1"
34+
DIFF=$(git diff --name-only HEAD~1)
35+
else
36+
echo "Workflow triggered on a branch, diffing with origin/main"
37+
DIFF=$(git diff --name-only origin/main)
38+
fi
39+
# Checks if a specific path has changed
40+
changed(){ echo "$DIFF" | grep -o $1; }
41+
if changed ".github/workflows/verify-manifest.yaml"; then
42+
# when changing the workflow, re-test all tox to check they still work
43+
echo "The workflow has been changed, all tox will be retriggered"
44+
changed(){ true; }
45+
fi;
46+
47+
echo -n "paths=[" >> to_output
48+
for path in \
49+
checkbox-ng \
50+
checkbox-support; do
51+
if changed $path; then
52+
echo -n "\"$path\"," >> to_output
53+
fi;
54+
done
55+
sed -i '$ s/.$//' to_output
56+
echo -n "]" >> to_output
57+
58+
cat to_output >> $GITHUB_STEP_SUMMARY
59+
cat to_output >> $GITHUB_OUTPUT
60+
61+
check_manifest_path:
62+
needs: get_path_matrix
63+
strategy:
64+
fail-fast: false
65+
matrix:
66+
path: ${{ fromJson(needs.get_path_matrix.outputs.path) }}
67+
name: Verify MANIFEST.in for ${{ matrix.path }}
68+
defaults:
69+
run:
70+
working-directory: ${{ matrix.path }}
71+
runs-on: 'ubuntu-latest'
72+
steps:
73+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
74+
with:
75+
persist-credentials: false
76+
- name: Install dependencies
77+
run: |
78+
sudo apt-get update
79+
sudo apt-get install -y -qq check-manifest
80+
- name: Run check-manifest
81+
run: check-manifest

checkbox-ng/MANIFEST.in

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ global-include COPYING LICENSE
66
global-include README*
77
global-include Vagrantfile
88

9+
exclude HACKING.md
10+
exclude .coveragerc
11+
exclude mk-venv
12+
exclude tox.ini
13+
914
include plainbox/impl/resource_constants.yaml
1015
include plainbox/impl/providers/categories/README.md
1116
include plainbox/impl/providers/categories/manage.py
@@ -37,6 +42,7 @@ recursive-include docs *.rst *.py *.html *.conf
3742
recursive-include plainbox/test-data *.json *.html *.tar.xz
3843
recursive-exclude debian *
3944
recursive-exclude build *
45+
recursive-exclude contrib *
4046

4147
include checkbox_ng/support/parsers/cputable
4248
recursive-include checkbox_ng/support/parsers/tests/cpuinfo_data *.txt

checkbox-support/MANIFEST.in

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
global-include COPYING
22
global-include README*
3+
global-include LICENSE*
4+
global-include CHANGELOG*
35
recursive-include checkbox_support/vendor/brisque/models *.txt *.pickle
46
recursive-include checkbox_support/snap_utils/tests/asserts_data *.txt
57
recursive-include checkbox_support/scripts/tests/test_data *.txt
68
recursive-exclude debian *
9+
exclude .coveragerc
10+
exclude tox.ini

0 commit comments

Comments
 (0)