All patches and comments are welcome. Please squash your changes to logical
commits before using git-format-patch and git-send-email to
patches@git.madduck.net.
If you'd read over the Git project's submission guidelines and adhered to them,
I'd be especially grateful.
6 paths: ["src/**", "setup.*", "pyproject.toml", ".github/workflows/*"]
9 paths: ["src/**", "setup.*", "pyproject.toml", ".github/workflows/*"]
12 group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
13 cancel-in-progress: true
17 runs-on: ubuntu-latest
19 matrix: ${{ steps.set-config.outputs.matrix }}
22 - uses: actions/checkout@v3
23 - uses: actions/setup-python@v4
27 - name: Install diff-shades and support dependencies
29 python -m pip install click packaging urllib3
30 python -m pip install https://github.com/ichard26/diff-shades/archive/stable.zip
32 - name: Calculate run configuration & metadata
35 GITHUB_TOKEN: ${{ github.token }}
37 python scripts/diff_shades_gha_helper.py config ${{ github.event_name }} ${{ matrix.mode }}
40 name: analysis / ${{ matrix.mode }}
42 runs-on: ubuntu-latest
44 # Clang is less picky with the C code it's given than gcc (and may
45 # generate faster binaries too).
50 include: ${{ fromJson(needs.configure.outputs.matrix )}}
53 - name: Checkout this repository (full clone)
54 uses: actions/checkout@v3
56 # The baseline revision could be rather old so a full clone is ideal.
59 - uses: actions/setup-python@v4
63 - name: Install diff-shades and support dependencies
65 python -m pip install https://github.com/ichard26/diff-shades/archive/stable.zip
66 python -m pip install click packaging urllib3
67 python -m pip install -r .github/mypyc-requirements.txt
68 # After checking out old revisions, this might not exist so we'll use a copy.
69 cat scripts/diff_shades_gha_helper.py > helper.py
70 git config user.name "diff-shades-gha"
71 git config user.email "diff-shades-gha@example.com"
73 - name: Attempt to use cached baseline analysis
75 uses: actions/cache@v3
77 path: ${{ matrix.baseline-analysis }}
78 key: ${{ matrix.baseline-cache-key }}
80 - name: Build and install baseline revision
81 if: steps.baseline-cache.outputs.cache-hit != 'true'
83 GITHUB_TOKEN: ${{ github.token }}
85 ${{ matrix.baseline-setup-cmd }}
86 && python setup.py --use-mypyc bdist_wheel
87 && python -m pip install dist/*.whl && rm build dist -r
89 - name: Analyze baseline revision
90 if: steps.baseline-cache.outputs.cache-hit != 'true'
92 diff-shades analyze -v --work-dir projects-cache/
93 ${{ matrix.baseline-analysis }} ${{ matrix.force-flag }}
95 - name: Build and install target revision
97 GITHUB_TOKEN: ${{ github.token }}
99 ${{ matrix.target-setup-cmd }}
100 && python setup.py --use-mypyc bdist_wheel
101 && python -m pip install dist/*.whl
103 - name: Analyze target revision
105 diff-shades analyze -v --work-dir projects-cache/
106 ${{ matrix.target-analysis }} --repeat-projects-from
107 ${{ matrix.baseline-analysis }} ${{ matrix.force-flag }}
109 - name: Generate HTML diff report
111 diff-shades --dump-html diff.html compare --diff
112 ${{ matrix.baseline-analysis }} ${{ matrix.target-analysis }}
114 - name: Upload diff report
115 uses: actions/upload-artifact@v3
117 name: ${{ matrix.mode }}-diff.html
120 - name: Upload baseline analysis
121 uses: actions/upload-artifact@v3
123 name: ${{ matrix.baseline-analysis }}
124 path: ${{ matrix.baseline-analysis }}
126 - name: Upload target analysis
127 uses: actions/upload-artifact@v3
129 name: ${{ matrix.target-analysis }}
130 path: ${{ matrix.target-analysis }}
132 - name: Generate summary file (PR only)
133 if: github.event_name == 'pull_request' && matrix.mode == 'preview-changes'
135 python helper.py comment-body
136 ${{ matrix.baseline-analysis }} ${{ matrix.target-analysis }}
137 ${{ matrix.baseline-sha }} ${{ matrix.target-sha }}
138 ${{ github.event.pull_request.number }}
140 - name: Upload summary file (PR only)
141 if: github.event_name == 'pull_request' && matrix.mode == 'preview-changes'
142 uses: actions/upload-artifact@v3
144 name: .pr-comment.json
145 path: .pr-comment.json
147 - name: Verify zero changes (PR only)
148 if: matrix.mode == 'assert-no-changes'
150 diff-shades compare --check ${{ matrix.baseline-analysis }} ${{ matrix.target-analysis }}
151 || (echo "Please verify you didn't change the stable code style unintentionally!" && exit 1)
153 - name: Check for failed files for target revision
154 # Even if the previous step failed, we should still check for failed files.
157 diff-shades show-failed --check --show-log ${{ matrix.target-analysis }}