Skip to content

Commit

Permalink
Create continuous_integration.yaml
Browse files Browse the repository at this point in the history
test build
  • Loading branch information
pbcccbeatboard-strato authored Aug 13, 2024
1 parent 659eb48 commit 90ae1c8
Showing 1 changed file with 73 additions and 0 deletions.
73 changes: 73 additions & 0 deletions .github/workflows/continuous_integration.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Continuous Integration (CI)
on:
push:
branches: ["main", "dev"]
pull_request:
branches:
- main
paths-ignore:
- "**.md"
- ".gitignore"
- ".git/**"
- "CODE_OF_CONFUCT.md"
- "CONTRIBUTING.md"
- "LICENSE"
- "README.md"
jobs:
build-source-chk:
name: Check source code
strategy:
matrix:
os: [ubuntu-22.04]
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v4

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'

- name: Test build & image create
run: echo 'gradle build & docker build'

- name: Setup Gradle
uses: gradle/actions/setup-gradle@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0

- name: grant execute permission for gradlew
run: chmod +x gradlew
shell: bash

- name: Build with Gradle Wrapper
run: ./gradlew test

build-source-and-container-image:
name: Build a container image
runs-on: ubuntu-22.04
needs: build-source-chk
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') }}

steps:
- uses: actions/checkout@v4

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'

- name: grant execute permission for gradlew
run: chmod +x gradlew
shell: bash

- name: Build with Gradle Wrapper
run: ./gradlew clean build --stacktrace

- name: chk directory
run: ls -al

- name: Build image
env:
IMAGE_NAME: ${{ github.event.repository.name }}
run: docker build . --file Dockerfile --tag $IMAGE_NAME

0 comments on commit 90ae1c8

Please sign in to comment.