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"]
9 path-ignore: ["docs/**", "tests/**", "*.md"]
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)"
32 name: analysis / linux
33 runs-on: ubuntu-latest
36 - name: Checkout this repository (full clone)
37 uses: actions/checkout@v2
41 - uses: actions/setup-python@v2
43 - name: Install diff-shades and support dependencies
45 python -m pip install pip --upgrade
46 python -m pip install https://github.com/ichard26/diff-shades/archive/stable.zip
47 python -m pip install click packaging urllib3
48 # After checking out old revisions, this might not exist so we'll use a copy.
49 cat scripts/diff_shades_gha_helper.py > helper.py
50 git config user.name "diff-shades-gha"
51 git config user.email "diff-shades-gha@example.com"
53 - name: Calculate run configuration & metadata
56 GITHUB_TOKEN: ${{ github.token }}
58 python helper.py config ${{ github.event_name }}
59 ${{ github.event.inputs.baseline }} ${{ github.event.inputs.target }}
60 --baseline-args "${{ github.event.inputs.baseline-args }}"
62 - name: Attempt to use cached baseline analysis
64 uses: actions/cache@v2.1.7
66 path: ${{ steps.config.outputs.baseline-analysis }}
67 key: ${{ steps.config.outputs.baseline-cache-key }}
69 - name: Install baseline revision
70 if: steps.baseline-cache.outputs.cache-hit != 'true'
72 GITHUB_TOKEN: ${{ github.token }}
73 run: ${{ steps.config.outputs.baseline-setup-cmd }} && python -m pip install .
75 - name: Analyze baseline revision
76 if: steps.baseline-cache.outputs.cache-hit != 'true'
78 diff-shades analyze -v --work-dir projects-cache/
79 ${{ steps.config.outputs.baseline-analysis }} -- ${{ github.event.inputs.baseline-args }}
81 - name: Install target revision
83 GITHUB_TOKEN: ${{ github.token }}
84 run: ${{ steps.config.outputs.target-setup-cmd }} && python -m pip install .
86 - name: Analyze target revision
88 diff-shades analyze -v --work-dir projects-cache/
89 ${{ steps.config.outputs.target-analysis }} --repeat-projects-from
90 ${{ steps.config.outputs.baseline-analysis }} -- ${{ github.event.inputs.target-args }}
92 - name: Generate HTML diff report
94 diff-shades --dump-html diff.html compare --diff --quiet
95 ${{ steps.config.outputs.baseline-analysis }} ${{ steps.config.outputs.target-analysis }}
97 - name: Upload diff report
98 uses: actions/upload-artifact@v2
103 - name: Upload baseline analysis
104 uses: actions/upload-artifact@v2
106 name: ${{ steps.config.outputs.baseline-analysis }}
107 path: ${{ steps.config.outputs.baseline-analysis }}
109 - name: Upload target analysis
110 uses: actions/upload-artifact@v2
112 name: ${{ steps.config.outputs.target-analysis }}
113 path: ${{ steps.config.outputs.target-analysis }}
115 - name: Generate summary file (PR only)
116 if: github.event_name == 'pull_request'
118 python helper.py comment-body
119 ${{ steps.config.outputs.baseline-analysis }} ${{ steps.config.outputs.target-analysis }}
120 ${{ steps.config.outputs.baseline-sha }} ${{ steps.config.outputs.target-sha }}
122 - name: Upload summary file (PR only)
123 if: github.event_name == 'pull_request'
124 uses: actions/upload-artifact@v2
126 name: .pr-comment-body.md
127 path: .pr-comment-body.md
129 # This is last so the diff-shades-comment workflow can still work even if we
130 # end up detecting failed files and failing the run.
131 - name: Check for failed files in both analyses
133 diff-shades show-failed --check --show-log ${{ steps.config.outputs.baseline-analysis }};
134 diff-shades show-failed --check --show-log ${{ steps.config.outputs.target-analysis }}