Skip to content
This repository has been archived by the owner on Dec 4, 2024. It is now read-only.

Commit

Permalink
Merge pull request #1 from 7SOATSquad30/build/add-ci-workflow
Browse files Browse the repository at this point in the history
build: add ci workflow
  • Loading branch information
MuriloKakazu authored May 1, 2024
2 parents ca5cce9 + 64ccc48 commit 02d6d3d
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 8 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: CI

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Setup JDK
uses: actions/setup-java@v3
with:
java-version: 21
distribution: 'zulu'

- name: Cache Gradle packages
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/build.gradle', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Code linting
run: ./gradlew spotlessCheck

- name: Build
run: ./gradlew clean build

- name: Run tests
run: ./gradlew test
18 changes: 18 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ plugins {
id 'java'
id 'org.springframework.boot' version '3.2.5'
id 'io.spring.dependency-management' version '1.1.4'
id 'com.diffplug.spotless' version '6.25.0'
}

group = 'br.com.fiap.grupo30'
Expand All @@ -17,6 +18,23 @@ configurations {
}
}

spotless {
format 'misc', {
// define the files to apply `misc` to
target '*.gradle', '.gitattributes', '.gitignore'

// define the steps to apply to those files
trimTrailingWhitespace()
indentWithTabs() // or spaces. Takes an integer argument if you don't like 4
endWithNewline()
}
java {
googleJavaFormat('1.22.0').aosp().reflowLongStrings().skipJavadocFormatting()
formatAnnotations()
target 'src/main/**/*.java', 'src/test/**/*.java'
}
}

repositories {
mavenCentral()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
@SpringBootApplication
public class FastfoodApplication {

public static void main(String[] args) {
SpringApplication.run(FastfoodApplication.class, args);
}

public static void main(String[] args) {
SpringApplication.run(FastfoodApplication.class, args);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
@SpringBootTest
class FastfoodApplicationTests {

@Test
void contextLoads() {
}

@Test
void contextLoads() {}
}

0 comments on commit 02d6d3d

Please sign in to comment.