Skip to content

Commit

Permalink
Test GHA
Browse files Browse the repository at this point in the history
  • Loading branch information
anthonysena committed Sep 17, 2024
1 parent 0f1de53 commit b553af9
Showing 1 changed file with 95 additions and 95 deletions.
190 changes: 95 additions & 95 deletions .github/workflows/publish_results_model.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:

services:
postgres:
image: postgres:14.0
image: postgres:latest
env:
POSTGRES_DB: mydb
POSTGRES_USER: user
Expand All @@ -24,98 +24,98 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Download and install dbmate
- name: Wait for PostgreSQL to be ready
run: |
curl -fsSL -o /usr/local/bin/dbmate https://github.com/amacneil/dbmate/releases/latest/download/dbmate-linux-amd64
chmod +x /usr/local/bin/dbmate
- name: Run migrations and dump data
run: |
make migrate
make dump_ci
mv db/schema.sql postgres_test.sql
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: postgres_test_sql
path: postgres_test.sql

documentation:
runs-on: ubuntu-latest
needs: build

services:
postgres:
image: postgres:14.0
env:
POSTGRES_DB: mydb
POSTGRES_USER: user
POSTGRES_PASSWORD: password
POSTGRES_HOST: postgres
POSTGRES_PORT: 5432
ports:
- 5432:5432
options: --name postgres --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5

steps:
- name: Checkout du code
uses: actions/checkout@v2

- name: download dump
uses: actions/download-artifact@v2
with:
name: postgres_test_sql
path: public

- name: Configure l'environnement pour SchemaSpy
run: |
sudo apt-get update
sudo apt-get install default-jdk -y
sudo apt-get install postgresql-client -y
sudo apt-get install graphviz -y
rm -r db
mkdir db
mv public/postgres_test.sql .
PGPASSWORD=password psql -U user -h localhost -p 5432 -d mydb -f postgres_test.sql
- name: Exécuter SchemaSpy
run: |
java -jar schemaspy-6.2.4.jar -configFile config.file -debug
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: documentation-artifact
path: public

deploy:
runs-on: ubuntu-latest
needs: documentation
steps:
- name: Exécuter SchemaSpy
run: |
ls
echo aaaaaaa
- name: Checkout du code
uses: actions/checkout@v2

- name: Exécuter SchemaSpy
run: |
ls
echo aaaaaaa
- name: download documentation
uses: actions/download-artifact@v2
with:
name: documentation-artifact
path: public


- name: "Deploy Github Pages"
uses: JamesIves/[email protected]
with:
BRANCH: gh-pages
FOLDER: public/
until pg_isready -h 127.0.0.1 -p 5432 -U myuser; do
echo "Waiting for postgres...";
sleep 3;
done
- name: Run SQL Script
run: |
PGPASSWORD=mypassword psql -h 127.0.0.1 -U myuser -d mydb -f extras/rdms/full_data_model_pg.sql
# - name: Upload artifact
# uses: actions/upload-artifact@v4
# with:
# name: postgres_test_sql
# path: postgres_test.sql
#
# documentation:
# runs-on: ubuntu-latest
# needs: build
#
# services:
# postgres:
# image: postgres:14.0
# env:
# POSTGRES_DB: mydb
# POSTGRES_USER: user
# POSTGRES_PASSWORD: password
# POSTGRES_HOST: postgres
# POSTGRES_PORT: 5432
# ports:
# - 5432:5432
# options: --name postgres --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
#
# steps:
# - name: Checkout du code
# uses: actions/checkout@v2
#
# - name: download dump
# uses: actions/download-artifact@v2
# with:
# name: postgres_test_sql
# path: public
#
# - name: Configure l'environnement pour SchemaSpy
# run: |
# sudo apt-get update
# sudo apt-get install default-jdk -y
# sudo apt-get install postgresql-client -y
# sudo apt-get install graphviz -y
# rm -r db
# mkdir db
# mv public/postgres_test.sql .
# PGPASSWORD=password psql -U user -h localhost -p 5432 -d mydb -f postgres_test.sql
#
#
# - name: Exécuter SchemaSpy
# run: |
# java -jar schemaspy-6.2.4.jar -configFile config.file -debug
#
# - name: Upload artifact
# uses: actions/upload-artifact@v2
# with:
# name: documentation-artifact
# path: public
#
# deploy:
# runs-on: ubuntu-latest
# needs: documentation
# steps:
# - name: Exécuter SchemaSpy
# run: |
# ls
# echo aaaaaaa
#
# - name: Checkout du code
# uses: actions/checkout@v2
#
# - name: Exécuter SchemaSpy
# run: |
# ls
# echo aaaaaaa
#
# - name: download documentation
# uses: actions/download-artifact@v2
# with:
# name: documentation-artifact
# path: public
#
#
# - name: "Deploy Github Pages"
# uses: JamesIves/[email protected]
# with:
# BRANCH: gh-pages
# FOLDER: public/

0 comments on commit b553af9

Please sign in to comment.