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

build: add ci workflow #1

Merged
merged 1 commit into from
May 1, 2024
Merged
Show file tree
Hide file tree
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
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() {}
}
Loading