-
Notifications
You must be signed in to change notification settings - Fork 21
Conversation
.github/workflows/ci.yml
Outdated
@@ -0,0 +1,15 @@ | |||
name: CI | |||
|
|||
on: [push] |
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 will trigger a full build every single time there is a push on any branch.
This should be scoped to just master for example, and only trigger builds for pull requests:
on:
pull_request
push:
branches:
- master
For testing purposes, what you can do is to trigger a push on your dev branch temporary
on:
push:
branches:
- mydevbranch
name: CI | ||
|
||
on: [push] | ||
|
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.
here you can add:
env:
GRADLE_USER_HOME: .gradle
uses: actions/setup-java@v1 | ||
with: | ||
java-version: 1.8 | ||
- name: Run Checks |
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.
and then you can add a cache here, as the project is very small, it will work:
- name: Cache dependencies
uses: actions/cache@v1
with:
path: .gradle/caches
key: gradle-cache-${{ hashFiles('**/*.gradle') }}
restore-keys: gradle-cache
.github/workflows/ci.yml
Outdated
with: | ||
java-version: 1.8 | ||
- name: Run Checks | ||
run: ./gradlew check --stacktrace |
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.
you can also add --no-daemon
, do we also need to add buid
?
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.
check
depends on build
so it's not required explicitly
add cache and build on pull requests/push to master
This adds a Github workflow to run the library tests.
Bonus: Had to update dependencies to make it work with Github Actions.