From 50290078da25e3980b54dfee041f47d27d04dcdb Mon Sep 17 00:00:00 2001 From: 16bravo Date: Wed, 20 Dec 2023 16:12:55 +0100 Subject: [PATCH] corrections yaml --- .github/workflows/gen_json.yml | 5 ++++- .github/workflows/init_database.yml | 14 ++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/.github/workflows/gen_json.yml b/.github/workflows/gen_json.yml index c3a819f1..6b2037e1 100644 --- a/.github/workflows/gen_json.yml +++ b/.github/workflows/gen_json.yml @@ -21,4 +21,7 @@ jobs: run: pip install -r requirements.txt - name: Run JSON generation script - run: python scripts/json_generation.py \ No newline at end of file + run: | + echo "Working Directory: $(pwd)" + echo "Files in Current Directory: $(ls -al)" + python scripts/json_generation.py \ No newline at end of file diff --git a/.github/workflows/init_database.yml b/.github/workflows/init_database.yml index 06450997..5c52c7d1 100644 --- a/.github/workflows/init_database.yml +++ b/.github/workflows/init_database.yml @@ -17,17 +17,31 @@ jobs: uses: actions/setup-python@v2 with: python-version: 3.x + - name: Vérifier l'existence de la base de données + id: check-db + run: | + if [ -f ./data/BranvoRanking.db ]; then + echo "Database exists already. No need for init." + echo "::set-output name=init_required::false" + else + echo "Database does not exist. Init needed." + echo "::set-output name=init_required::true" + fi - name: Install dependencies + if: steps.check-db.outputs.init_required == 'true' run: pip install -r requirements.txt - name: Create .kaggle directory + if: steps.check-db.outputs.init_required == 'true' run: mkdir -p /home/runner/.kaggle - name: Set up Kaggle credentials + if: steps.check-db.outputs.init_required == 'true' run: echo "$KAGGLE_JSON" > /home/runner/.kaggle/kaggle.json && chmod 600 /home/runner/.kaggle/kaggle.json env: KAGGLE_JSON: ${{ secrets.KAGGLE_JSON }} - name: Run initialization script + if: steps.check-db.outputs.init_required == 'true' run: python scripts/db_initialisation.py \ No newline at end of file