From 6fbe2c4ec7ffe05b9bb0c87b2befa73732553b4e Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Tue, 31 Oct 2023 22:05:13 +0500 Subject: [PATCH] build: capturing new migrations. --- .github/workflows/capture_new_migrations.yml | 111 ++++++++++--------- 1 file changed, 56 insertions(+), 55 deletions(-) diff --git a/.github/workflows/capture_new_migrations.yml b/.github/workflows/capture_new_migrations.yml index c4e43d2073f1..5d546366f7cf 100644 --- a/.github/workflows/capture_new_migrations.yml +++ b/.github/workflows/capture_new_migrations.yml @@ -82,31 +82,31 @@ jobs: with: python-version: ${{ matrix.python-version }} -# - name: Install system Packages -# run: | -# sudo apt-get update -# make ubuntu-requirements -# -# - name: Get pip cache dir -# id: pip-cache-dir -# run: | -# echo "::set-output name=dir::$(pip cache dir)" - -# - name: Cache pip dependencies -# id: cache-dependencies -# uses: actions/cache@v3 -# with: -# path: ${{ steps.pip-cache-dir.outputs.dir }} -# key: ${{ runner.os }}-pip-${{ hashFiles('requirements/edx/development.txt') }} -# restore-keys: ${{ runner.os }}-pip- -# -# - name: Install Python dependencies -# run: | -# make dev-requirements -# if [[ "${{ matrix.django-version }}" != "pinned" ]]; then -# pip install "django~=${{ matrix.django-version }}.0" -# pip check # fail if this test-reqs/Django combination is broken -# fi + - name: Install system Packages + run: | + sudo apt-get update + make ubuntu-requirements + + - name: Get pip cache dir + id: pip-cache-dir + run: | + echo "::set-output name=dir::$(pip cache dir)" + + - name: Cache pip dependencies + id: cache-dependencies + uses: actions/cache@v3 + with: + path: ${{ steps.pip-cache-dir.outputs.dir }} + key: ${{ runner.os }}-pip-${{ hashFiles('requirements/edx/development.txt') }} + restore-keys: ${{ runner.os }}-pip- + + - name: Install Python dependencies + run: | + make dev-requirements + if [[ "${{ matrix.django-version }}" != "pinned" ]]; then + pip install "django~=${{ matrix.django-version }}.0" + pip check # fail if this test-reqs/Django combination is broken + fi # - name: Run Tests # env: @@ -119,29 +119,30 @@ jobs: # echo "Running the CMS migrations." # ./manage.py cms migrate - - name: "Setup env vars" - id: envvars - run: | - number1=10 - number2=5 - echo "Number 1: $number1" - echo "Number 2: $number2" - result=$((number1 - number2)) - echo "Result: $result" - echo "SUBTRACTION_RESULT=$result" >> $GITHUB_ENV - shell: bash - - - name: Use subtraction result - run: | - subtraction_result=${{ env.SUBTRACTION_RESULT }} - echo "Subtraction Result: $subtraction_result" +# - name: "Setup env vars" +# id: envvars +# run: | +# number1=10 +# number2=5 +# echo "Number 1: $number1" +# echo "Number 2: $number2" +# result=$((number1 - number2)) +# echo "Result: $result" +# echo "SUBTRACTION_RESULT=$result" >> $GITHUB_ENV +# shell: bash +# +# - name: Use subtraction result +# run: | +# subtraction_result=${{ env.SUBTRACTION_RESULT }} +# echo "Subtraction Result: $subtraction_result" - name: Verify executed migrations on master. id: capture1 shell: bash run: | query_result1=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select 1;" edxapp;) - numeric_result = $(echo "$query_result" | tr -d '[:space:]') + numeric_result=$(echo "$query_result" | tr -d '[:space:]') + echo "Numeric Result: $numeric_result" echo "FIRST_QUERY=$numeric_result" >> $GITHUB_ENV - name: Step 12 @@ -181,22 +182,22 @@ jobs: run: | captured_result="${{ env.query_r }}" echo "Captured Output: $captured_result" -# query_result1=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select 1;" edxapp;) -# echo "Query Result: query_result1" -# echo "query_result1=${query_result1}" >> $GITHUB_ENV -# shell: bash + query_result=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select count(*) from django_migrations;" edxapp;) + numeric_result=$(echo "$query_result" | tr -d '[:space:]') + echo "Numeric Result: $numeric_result" + echo "FIRST_QUERY=$numeric_result" >> $GITHUB_ENV - name: Verify difference run: | - echo "echo ${{env.query_result}}" - echo "echo ${{env.query_result1}}" - number1=${{ env.query_result1 }} - number2=${{ env.query_result1 }} - # Perform subtraction - diff=$((number1 - number2)) - result=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select 1 ;" edxapp;) - echo "Query Result: $result" - echo "$result" + echo "echo ${{env.FIRST_QUERY}}" +# echo "echo ${{env.query_result1}}" +# number1=${{ env.query_result1 }} +# number2=${{ env.query_result1 }} +# # Perform subtraction +# diff=$((number1 - number2)) +# result=$(mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select 1 ;" edxapp;) +# echo "Query Result: $result" +# echo "$result" shell: bash