-
Notifications
You must be signed in to change notification settings - Fork 14.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build: try to speed up Github workflows #12090
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
556b52e
build: another approach to cancel Github workflows
ktmud 0622739
Display number of jobs to cancel
ktmud be3098b
build: ignore github actions from dependabot
ktmud abf1d21
Merge mysql postgres and sqlite tests
ktmud 6434014
Don't use pull_request_target
ktmud 85993fd
Dont ignore pull request checks
ktmud File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: Cancel Duplicates | ||
on: | ||
workflow_run: | ||
workflows: ["CI"] | ||
types: ["requested"] | ||
|
||
jobs: | ||
cancel-duplicate-workflow-runs: | ||
name: "Cancel duplicate workflow runs" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: apache-superset/cancel-workflow-runs@953e057 | ||
name: "Cancel duplicate workflow runs" | ||
with: | ||
cancelMode: duplicates | ||
cancelFutureDuplicates: true | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
sourceRunId: ${{ github.event.workflow_run.id }} | ||
notifyPRCancel: true | ||
skipEventTypes: '["push", "pull_request", "pull_request_target"]' |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
name: Miscellaneous | ||
|
||
on: | ||
push: | ||
branches-ignore: | ||
- "dependabot/**" | ||
pull_request: | ||
|
||
jobs: | ||
license_check: | ||
name: License Check | ||
runs-on: ubuntu-18.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Setup Java | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: 8 | ||
- name: Generate fossa report | ||
env: | ||
FOSSA_API_KEY: ${{ secrets.FOSSA_API_KEY }} | ||
run: | | ||
set -eo pipefail | ||
if [[ "${{github.event_name}}" != "pull_request" ]]; then | ||
./scripts/fossa.sh | ||
exit 0 | ||
fi | ||
|
||
URL="https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/files" | ||
FILES=$(curl -s -X GET -G $URL | jq -r '.[] | .filename') | ||
|
||
cat<<EOF | ||
CHANGED FILES: | ||
$FILES | ||
|
||
EOF | ||
|
||
if [[ "${FILES}" =~ (.*package*\.json|requirements\/[a-z_-]+\.txt|setup\.py) ]]; then | ||
echo "Detected dependency changes... running fossa check" | ||
|
||
./scripts/fossa.sh | ||
else | ||
echo "No dependency changes... skiping fossa check" | ||
fi | ||
shell: bash | ||
- name: Run license check | ||
run: ./scripts/check_license.sh | ||
|
||
prefer_typescript: | ||
if: github.ref == 'ref/heads/master' && github.event_name == 'pull_request' | ||
name: Prefer Typescript | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Get changed files | ||
id: changed | ||
uses: ./.github/actions/file-changes-action | ||
with: | ||
githubToken: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Determine if a .js or .jsx file was added | ||
id: check | ||
run: | | ||
js_files_added() { | ||
jq -r ' | ||
map( | ||
select( | ||
endswith(".js") or endswith(".jsx") | ||
) | ||
) | join("\n") | ||
' ${HOME}/files_added.json | ||
} | ||
echo ::set-output name=js_files_added::$(js_files_added) | ||
|
||
- if: steps.check.outputs.js_files_added | ||
name: Add Comment to PR | ||
uses: ./.github/actions/comment-on-pr | ||
continue-on-error: true | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
msg: | | ||
### WARNING: Prefer TypeScript | ||
|
||
Looks like your PR contains new `.js` or `.jsx` files: | ||
|
||
``` | ||
${{steps.check.outputs.js_files_added}} | ||
``` | ||
|
||
As decided in [SIP-36](https://github.com/apache/superset/issues/9101), all new frontend code should be written in TypeScript. Please convert above files to TypeScript then re-request review. |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This check is essentially useless since the comments will never work for PRs coming from forks (due to the GITHUB_TOKEN access). This would be a good candidate to port over to the
workflow_run
approach mentioned in https://securitylab.github.com/research/github-actions-preventing-pwn-requests. Obviously, out of scope for this PR