-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
81 additions
and
1 deletion.
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,81 @@ | ||
name: DKV CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
dkv_server_job: | ||
runs-on: ubuntu-latest | ||
name: Build Docker Server & Run Tests | ||
services: | ||
registry: | ||
image: registry:2 | ||
ports: | ||
- 5000:5000 | ||
steps: | ||
# To use this repository's private action, | ||
# you must check out the repository | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Prepopulate Docker file | ||
run: | | ||
echo "COPY . /code" >> Dockerfile | ||
cat ./Dockerfile | ||
# This is the a separate action that sets up buildx runner | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
with: | ||
driver-opts: network=host | ||
# So now you can use Actions' own caching! | ||
- name: Cache Docker layers | ||
uses: actions/cache@v2 | ||
with: | ||
path: /tmp/.buildx-cache | ||
key: ${{ runner.os }}-buildx-${{ github.sha }} | ||
restore-keys: | | ||
${{ runner.os }}-buildx- | ||
- name: Build Docker Container | ||
uses: docker/build-push-action@v2 | ||
with: | ||
# using "load: true" forces the docker driver | ||
# not necessary here, because we set it before | ||
#load: true | ||
push: true | ||
tags: localhost:5000/${{ github.repository_owner }}/dkv:latest | ||
context: . | ||
file: ./Dockerfile | ||
cache-from: type=local,src=/tmp/.buildx-cache | ||
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max | ||
- name: Run tests | ||
run: | | ||
docker run -i localhost:5000/${{ github.repository_owner }}/dkv:latest bash -c "cd /code && GOOS=linux GOARCH=amd64 make test" | ||
- name: Move cache | ||
run: | | ||
rm -rf /tmp/.buildx-cache | ||
mv /tmp/.buildx-cache-new /tmp/.buildx-cache | ||
dkv_java_client_job: | ||
runs-on: ubuntu-latest | ||
name: Build Java Client | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up JDK 9 | ||
uses: actions/setup-java@v2 | ||
with: | ||
java-version: '9' | ||
distribution: 'adopt' | ||
- name: Cache Maven packages | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.m2 | ||
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} | ||
restore-keys: ${{ runner.os }}-m2 | ||
- name: Build with Maven | ||
run: | | ||
cd clients/java/dkv-client | ||
mvn clean install -DskipTests -Dmaven.test.skip=true |
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 |
---|---|---|
|
@@ -51,4 +51,3 @@ crashlytics-build.properties | |
|
||
.DS_Store | ||
bin/ | ||
|