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-ignore: ["docs/**", "tests/**", "**.md", "**.rst"]
9 paths-ignore: ["docs/**", "tests/**", "**.md", "**.rst"]
15 The baseline revision. Pro-tip, use `.pypi` to use the latest version
16 on PyPI or `.XXX` to use a PR.
20 description: "Custom Black arguments (eg. -l 79)"
24 The target revision to compare against the baseline. Same tip applies here.
27 description: "Custom Black arguments (eg. -S)"
31 group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
32 cancel-in-progress: true
36 name: analysis / linux
37 runs-on: ubuntu-latest
39 # Clang is less picky with the C code it's given than gcc (and may
40 # generate faster binaries too).
44 - name: Checkout this repository (full clone)
45 uses: actions/checkout@v2
49 - uses: actions/setup-python@v2
51 - name: Install diff-shades and support dependencies
53 python -m pip install pip --upgrade
54 python -m pip install https://github.com/ichard26/diff-shades/archive/stable.zip
55 python -m pip install click packaging urllib3
56 python -m pip install -r .github/mypyc-requirements.txt
57 # After checking out old revisions, this might not exist so we'll use a copy.
58 cat scripts/diff_shades_gha_helper.py > helper.py
59 git config user.name "diff-shades-gha"
60 git config user.email "diff-shades-gha@example.com"
62 - name: Calculate run configuration & metadata
65 GITHUB_TOKEN: ${{ github.token }}
67 python helper.py config ${{ github.event_name }}
68 ${{ github.event.inputs.baseline }} ${{ github.event.inputs.target }}
69 --baseline-args "${{ github.event.inputs.baseline-args }}"
71 - name: Attempt to use cached baseline analysis
73 uses: actions/cache@v2.1.7
75 path: ${{ steps.config.outputs.baseline-analysis }}
76 key: ${{ steps.config.outputs.baseline-cache-key }}
78 - name: Build and install baseline revision
79 if: steps.baseline-cache.outputs.cache-hit != 'true'
81 GITHUB_TOKEN: ${{ github.token }}
83 ${{ steps.config.outputs.baseline-setup-cmd }}
84 && python setup.py --use-mypyc bdist_wheel
85 && python -m pip install dist/*.whl && rm build dist -r
87 - name: Analyze baseline revision
88 if: steps.baseline-cache.outputs.cache-hit != 'true'
90 diff-shades analyze -v --work-dir projects-cache/
91 ${{ steps.config.outputs.baseline-analysis }} -- ${{ github.event.inputs.baseline-args }}
93 - name: Build and install target revision
95 GITHUB_TOKEN: ${{ github.token }}
97 ${{ steps.config.outputs.target-setup-cmd }}
98 && python setup.py --use-mypyc bdist_wheel
99 && python -m pip install dist/*.whl
101 - name: Analyze target revision
103 diff-shades analyze -v --work-dir projects-cache/
104 ${{ steps.config.outputs.target-analysis }} --repeat-projects-from
105 ${{ steps.config.outputs.baseline-analysis }} -- ${{ github.event.inputs.target-args }}
107 - name: Generate HTML diff report
109 diff-shades --dump-html diff.html compare --diff --quiet
110 ${{ steps.config.outputs.baseline-analysis }} ${{ steps.config.outputs.target-analysis }}
112 - name: Upload diff report
113 uses: actions/upload-artifact@v2
118 - name: Upload baseline analysis
119 uses: actions/upload-artifact@v2
121 name: ${{ steps.config.outputs.baseline-analysis }}
122 path: ${{ steps.config.outputs.baseline-analysis }}
124 - name: Upload target analysis
125 uses: actions/upload-artifact@v2
127 name: ${{ steps.config.outputs.target-analysis }}
128 path: ${{ steps.config.outputs.target-analysis }}
130 - name: Generate summary file (PR only)
131 if: github.event_name == 'pull_request'
133 python helper.py comment-body
134 ${{ steps.config.outputs.baseline-analysis }} ${{ steps.config.outputs.target-analysis }}
135 ${{ steps.config.outputs.baseline-sha }} ${{ steps.config.outputs.target-sha }}
136 ${{ github.event.pull_request.number }}
138 - name: Upload summary file (PR only)
139 if: github.event_name == 'pull_request'
140 uses: actions/upload-artifact@v2
142 name: .pr-comment.json
143 path: .pr-comment.json
145 # This is last so the diff-shades-comment workflow can still work even if we
146 # end up detecting failed files and failing the run.
147 - name: Check for failed files in both analyses
149 diff-shades show-failed --check --show-log ${{ steps.config.outputs.baseline-analysis }};
150 diff-shades show-failed --check --show-log ${{ steps.config.outputs.target-analysis }}