Skip to content

Commit

Permalink
feature/pipeline (#2)
Browse files Browse the repository at this point in the history
* add workflow maven file

* edit workflow file

* fix workflow

* fix worflow

* test pipeline

* add maven surefire plugin to pom.xml

* add maven surefire plugin to pom.xml

* fix maven.yml

* fix maven.yml

* fix maven.yml

* fix maven.yml

* fix maven.yml

* add caching

* add caching

* run tests

* add pg service to github actions runner

* modify actions

* modify actions
  • Loading branch information
xalpol12 authored Jan 14, 2024
1 parent fe47934 commit 9e7bb93
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 1 deletion.
42 changes: 42 additions & 0 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Java CI with Maven

on:
push:
branches: [ "main", "feature/pipeline" ]
pull_request:
branches: [ "main" ]

jobs:
java-tests:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:latest
env:
POSTGRES_DB: ms-bot
POSTGRES_USER: postgres
POSTGRES_PASSWORD: admin
ports:
- 5432:5432
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
architecture: x64
cache: maven

- name: Cache the Maven packages to speed up build
uses: actions/cache@v3
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2

- name: Run the Maven test
run: mvn test

- name: Update dependency graph
uses: advanced-security/maven-dependency-submission-action@571e99aab1055c2e71a1e2309b9691de18d6b7d6
4 changes: 4 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@

<build>
<plugins>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.2.5</version>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/application-local.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
spring.config.import=classpath:secrets.properties
spring.config.import=optional:classpath:secrets.properties

spring.datasource.url=jdbc:postgresql://localhost:5432/ms-bot

Expand Down

0 comments on commit 9e7bb93

Please sign in to comment.