Skip to content

Commit

Permalink
build: capturing new migrations.
Browse files Browse the repository at this point in the history
  • Loading branch information
awais786 committed Oct 31, 2023
1 parent 5387113 commit 6fbe2c4
Showing 1 changed file with 56 additions and 55 deletions.
111 changes: 56 additions & 55 deletions .github/workflows/capture_new_migrations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down Expand Up @@ -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


Expand Down

0 comments on commit 6fbe2c4

Please sign in to comment.