-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: David Caro <[email protected]>
- Loading branch information
1 parent
4a90c2b
commit b4ec8df
Showing
6 changed files
with
120 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: CI | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Setup Podman | ||
run: | | ||
sudo apt update | ||
sudo apt-get -y install podman | ||
- name: Get source | ||
uses: actions/checkout@v3 | ||
with: | ||
path: "expenses-server" | ||
- name: start DB | ||
run: | | ||
cd expenses-server | ||
./scripts/start_devdb.sh populate | ||
- name: start app | ||
run: | | ||
cd expenses-server | ||
mkdir -p ../home-lab-secrets/home_automation/expenses/ | ||
echo "accounts-config: {'accounts': []}" > ../home-lab-secrets/home_automation/expenses/application-accounts.yml | ||
pwd | ||
mkdir -p .gradle | ||
./scripts/start_dev.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 6 additions & 1 deletion
7
src/main/java/com/shareexpenses/server/expenses/ExpensesRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,15 @@ | ||
package com.shareexpenses.server.expenses; | ||
|
||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.data.jpa.repository.Query; | ||
import java.util.List; | ||
|
||
public interface ExpensesRepository extends JpaRepository<Expense, Long> { | ||
public interface ExpensesRepository extends JpaRepository<Expense, Long> { | ||
List<Expense> findAll(); | ||
|
||
@Query(value = "SELECT 1 FROM expenses limit 1", nativeQuery = true) | ||
// The return value does not really matter, just that it did not blow up | ||
List<Integer> checkDB(); | ||
|
||
boolean existsByExternalId(String externalId); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters