Add static-checks Github Action#13347
Conversation
|
|
||
| name: Static Checks CI | ||
| on: | ||
| pull_request: |
There was a problem hiding this comment.
I think we also need this GitHub Action to run on each commit on master and release branch.
e.g.
on:
push:
branches: [ master ]There was a problem hiding this comment.
BTW, why does the GitHub Action not run for this PR?
There was a problem hiding this comment.
it's possible that Infra needs to enable actions for this repo?
There was a problem hiding this comment.
Seems like it. This runs on a PR raised in the fork repo.
There was a problem hiding this comment.
https://the-asf.slack.com/archives/CBX4TSBQ8/p1668410098261039 - We need to merge the first PR before it can get triggered.
|
Here is the Static Checks CI GitHub actions on a forked repo - https://github.com/tejaswini-imply/druid/actions/runs/3442505350 |
imply-elliott
left a comment
There was a problem hiding this comment.
Generally looks great for a basic pipeline we can iterate upon!
.github/workflows/static-checks.yml
Outdated
| cache: 'maven' | ||
| - run: | | ||
| echo 'Running Maven install...' && | ||
| MAVEN_OPTS='-Xmx3000m' \ |
There was a problem hiding this comment.
Let's move this to a env variable so it's set the same way as others and universally applied:
env:
MAVEN_OPTS: -Xmx3000m
|
|
||
| sudo apt-get update && sudo apt-get install python3 -y | ||
| curl https://bootstrap.pypa.io/pip/3.5/get-pip.py | sudo -H python3 | ||
| ../../check_test_suite.py && travis_terminate 0 || echo 'Continuing setup' |
There was a problem hiding this comment.
What's this reference to travis_terminate here? I saw this in my tests too and I don't think this will work in Actions?
.github/workflows/static-checks.yml
Outdated
| java-version: '8' | ||
| cache: 'maven' | ||
| - run: |- | ||
| MAVEN_OPTS='-Xmx3000m' ${MVN} ${MAVEN_SKIP} dependency:analyze -DoutputXML=true -DignoreNonCompile=true -DfailOnWarning=true ${{ matrix.HADOOP_PROFILE }} || |
There was a problem hiding this comment.
We can pull out MAVEN_OPTS here when set as a global env variable.
.github/workflows/static-checks.yml
Outdated
| # errorprone requires JDK 11 | ||
| # Strict compilation requires more than 2 GB | ||
| - run: | | ||
| MAVEN_OPTS='-Xmx3000m' ${MVN} clean -DstrictCompile compile test-compile --fail-at-end ${MAVEN_SKIP} ${MAVEN_SKIP_TESTS} |
There was a problem hiding this comment.
We can pull out MAVEN_OPTS here when set as a global env variable.
| needs: [build] | ||
| steps: | ||
| - uses: actions/checkout@v3 | ||
| - name: setup java 8 |
There was a problem hiding this comment.
Do we expect to only run some of these checks with java 8, or should they eventually be run for all supported versions?
There was a problem hiding this comment.
Maybe eventually, This is the existing flow with Travis checks.
|
Thanks for the review @imply-elliott, I have addressed your comments in the latest commit. PTAL. |
imply-elliott
left a comment
There was a problem hiding this comment.
Thanks for addressing my comments!
We are moving away from the Travis CI/CD pipeline to GitHub Actions. As the first step, this PR adds static-checks GitHub action (triggered on any pull request activity) to run all the below steps:
Optimizations implemented: