Skip to content
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

Create stub for gh actions #54

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 75 additions & 0 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Java CI with Gradle

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

permissions:
contents: read

env:
DOCKER_HOST: tcp://docker:2375
DOCKER_DRIVER: overlay2
DOCKER_TLS_CERTDIR: ""
IMAGE_NAME: emcmongoose/mongoose-base
IMAGE_FILE_NAME: build/mongoose-base.tar
ROBOTEST_CONTAINER_WORKING_DIR: /root/mongoose


jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Execute Gradle build
run: ./gradlew clean jar
- name: Upload a Build Artifact
uses: actions/upload-artifact@v3.1.0
with:
name: mongoose.jar
path: ./build/libs/
if-no-files-found: error
retention-days: 1 # optional
- name: Execute Gradle unit test
run: ./gradlew test
- name: Upload a failed unit test artifact
uses: actions/upload-artifact@v3.1.0
with:
name: testFailure.log
path: ./build/reports/tests/test/*
if-no-files-found: error
retention-days: 14 # optional
if: failure()
- name: Execute Gradle integration test
run: ./gradlew integrationTest
- name: Upload a failed integration test artifact
uses: actions/upload-artifact@v3.1.0
with:
name: testFailure.log
path: ./build/reports/tests/integrationTest/*
if-no-files-found: error
retention-days: 14 # optional
if: failure()
- uses: actions/checkout@v3
- name: Build the Docker image
run: docker build . --file ci/docker/Dockerfile --tag my-image-name:${GITHUB_SHA}
- name: Upload a failed test artifact
uses: actions/upload-artifact@v3.1.0
with:
name: testFailure.log
path: ./build/reports/tests/integrationTest/*
if-no-files-found: error
retention-days: 14 # optional