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@v3
25 - name: Install diff-shades and support dependencies
27 python -m pip install click packaging urllib3
28 python -m pip install https://github.com/ichard26/diff-shades/archive/stable.zip
30 - name: Calculate run configuration & metadata
33 GITHUB_TOKEN: ${{ github.token }}
35 python scripts/diff_shades_gha_helper.py config ${{ github.event_name }} ${{ matrix.mode }}
38 name: analysis / ${{ matrix.mode }}
40 runs-on: ubuntu-latest
42 # Clang is less picky with the C code it's given than gcc (and may
43 # generate faster binaries too).
48 include: ${{ fromJson(needs.configure.outputs.matrix )}}
51 - name: Checkout this repository (full clone)
52 uses: actions/checkout@v3
54 # The baseline revision could be rather old so a full clone is ideal.
57 - uses: actions/setup-python@v3
59 - name: Install diff-shades and support dependencies
61 python -m pip install https://github.com/ichard26/diff-shades/archive/stable.zip
62 python -m pip install click packaging urllib3
63 python -m pip install -r .github/mypyc-requirements.txt
64 # After checking out old revisions, this might not exist so we'll use a copy.
65 cat scripts/diff_shades_gha_helper.py > helper.py
66 git config user.name "diff-shades-gha"
67 git config user.email "diff-shades-gha@example.com"
69 - name: Attempt to use cached baseline analysis
71 uses: actions/cache@v3
73 path: ${{ matrix.baseline-analysis }}
74 key: ${{ matrix.baseline-cache-key }}
76 - name: Build and install baseline revision
77 if: steps.baseline-cache.outputs.cache-hit != 'true'
79 GITHUB_TOKEN: ${{ github.token }}
81 ${{ matrix.baseline-setup-cmd }}
82 && python setup.py --use-mypyc bdist_wheel
83 && python -m pip install dist/*.whl && rm build dist -r
85 - name: Analyze baseline revision
86 if: steps.baseline-cache.outputs.cache-hit != 'true'
88 diff-shades analyze -v --work-dir projects-cache/
89 ${{ matrix.baseline-analysis }} ${{ matrix.force-flag }}
91 - name: Build and install target revision
93 GITHUB_TOKEN: ${{ github.token }}
95 ${{ matrix.target-setup-cmd }}
96 && python setup.py --use-mypyc bdist_wheel
97 && python -m pip install dist/*.whl
99 - name: Analyze target revision
101 diff-shades analyze -v --work-dir projects-cache/
102 ${{ matrix.target-analysis }} --repeat-projects-from
103 ${{ matrix.baseline-analysis }} ${{ matrix.force-flag }}
105 - name: Generate HTML diff report
107 diff-shades --dump-html diff.html compare --diff
108 ${{ matrix.baseline-analysis }} ${{ matrix.target-analysis }}
110 - name: Upload diff report
111 uses: actions/upload-artifact@v2
113 name: ${{ matrix.mode }}-diff.html
116 - name: Upload baseline analysis
117 uses: actions/upload-artifact@v2
119 name: ${{ matrix.baseline-analysis }}
120 path: ${{ matrix.baseline-analysis }}
122 - name: Upload target analysis
123 uses: actions/upload-artifact@v2
125 name: ${{ matrix.target-analysis }}
126 path: ${{ matrix.target-analysis }}
128 - name: Generate summary file (PR only)
129 if: github.event_name == 'pull_request' && matrix.mode == 'preview-changes'
131 python helper.py comment-body
132 ${{ matrix.baseline-analysis }} ${{ matrix.target-analysis }}
133 ${{ matrix.baseline-sha }} ${{ matrix.target-sha }}
134 ${{ github.event.pull_request.number }}
136 - name: Upload summary file (PR only)
137 if: github.event_name == 'pull_request' && matrix.mode == 'preview-changes'
138 uses: actions/upload-artifact@v2
140 name: .pr-comment.json
141 path: .pr-comment.json
143 - name: Verify zero changes (PR only)
144 if: matrix.mode == 'assert-no-changes'
146 diff-shades compare --check ${{ matrix.baseline-analysis }} ${{ matrix.target-analysis }}
147 || (echo "Please verify you didn't change the stable code style unintentionally!" && exit 1)
149 - name: Check for failed files for target revision
150 # Even if the previous step failed, we should still check for failed files.
153 diff-shades show-failed --check --show-log ${{ matrix.target-analysis }}
154 --check-allow 'sqlalchemy:test/orm/test_relationship_criteria.py'