Skip to content

Commit

Permalink
refactor: use environmental variable for diff file location
Browse files Browse the repository at this point in the history
  • Loading branch information
iisakkirotko authored and maartenbreddels committed Aug 29, 2024
1 parent 1f61c05 commit ce7a9d9
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ jobs:
python-version: ["3.9", "3.12"] # 3.9 is the lowest version pre-commit supports
env:
LOCK_FILE_LOCATION: .ci-package-locks/code-quality/python${{ matrix.python-version }}.txt
DIFF_FILE_LOCATION: diff-code-quality-python${{ matrix.python-version }}.txt

steps:
- uses: actions/checkout@v4
Expand All @@ -140,8 +141,8 @@ jobs:
mkdir -p .ci-package-locks/code-quality
pip install pre-commit
pip freeze --exclude solara --exclude solara-enterprise > ${{ env.LOCK_FILE_LOCATION }}
git diff --exit-code | tee diff-code-quality-python${{ matrix.python-version }}.txt
[ -s diff-code-quality-python${{ matrix.python-version }}.txt ] || echo "HAS_DIFF=true" >> "$GITHUB_OUTPUT"
git diff --exit-code | tee ${{ env.DIFF_FILE_LOCATION }}
[ -s ${{ env.DIFF_FILE_LOCATION }} ] || echo "HAS_DIFF=true" >> "$GITHUB_OUTPUT"
- name: Install
if: github.event_name != 'schedule' && steps.prepare.outputs.LOCKS_EXIST == 'true'
Expand All @@ -159,7 +160,7 @@ jobs:
with:
name: test-results-code-quality-python${{ matrix.python-version }}
path: |
diff-code-quality-python${{ matrix.python-version }}.txt
${{ env.DIFF_FILE_LOCATION }}
./**/${{ env.LOCK_FILE_LOCATION }}
- name: Upload CI package locks
Expand Down Expand Up @@ -248,6 +249,7 @@ jobs:
ipywidgets: "8.0"
env:
LOCK_FILE_LOCATION: .ci-package-locks/integration/os${{ matrix.os }}-python${{ matrix.python-version }}-ipywidgets${{ matrix.ipywidgets_major }}.txt
DIFF_FILE_LOCATION: diff-integration-os${{ matrix.os }}-python${{ matrix.python-version }}-ipywidgets${{ matrix.ipywidgets_major }}.txt

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -296,8 +298,8 @@ jobs:
pip install `echo packages/solara-enterprise/dist/*.whl`[ssg,auth]
pip install "jupyterlab<4" "pydantic<2" "playwright==1.41.2" "ipywidgets~=${{ matrix.ipywidgets }}"
pip freeze --exclude solara --exclude solara-ui --exclude solara-server --exclude pytest-ipywidgets --exclude solara-enterprise > ${{ env.LOCK_FILE_LOCATION }}
git diff --exit-code | tee diff-integration-os${{ matrix.os }}-python${{ matrix.python-version }}-ipywidgets${{ matrix.ipywidgets_major }}.txt
[ -s diff-integration-os${{ matrix.os }}-python${{ matrix.python-version }}-ipywidgets${{ matrix.ipywidgets_major }}.txt ] || echo "HAS_DIFF=true" >> "$GITHUB_OUTPUT"
git diff --exit-code | tee ${{ env.DIFF_FILE_LOCATION }}
[ -s ${{ env.DIFF_FILE_LOCATION }} ] || echo "HAS_DIFF=true" >> "$GITHUB_OUTPUT"
- name: Install
if: github.event_name != 'schedule' && steps.prepare.outputs.LOCKS_EXIST == 'true'
Expand Down Expand Up @@ -331,7 +333,7 @@ jobs:
name: test-results-integration-os${{ matrix.os }}-python${{ matrix.python-version }}-ipywidgets${{ matrix.ipywidgets_major }}
path: |
test-results
diff-integration-os${{ matrix.os }}-python${{ matrix.python-version }}-ipywidgets${{ matrix.ipywidgets_major }}.txt
${{ env.DIFF_FILE_LOCATION }}
./**/${{ env.LOCK_FILE_LOCATION }}
- name: Upload CI package locks
Expand Down Expand Up @@ -359,6 +361,7 @@ jobs:
ipywidgets: "8.0"
env:
LOCK_FILE_LOCATION: .ci-package-locks/integration-vue3/os${{ matrix.os }}-ipywidgets${{ matrix.ipywidgets_major }}.txt
DIFF_FILE_LOCATION: diff-integration-vue3-os${{ matrix.os }}-ipywidgets${{ matrix.ipywidgets_major }}.txt

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -402,8 +405,8 @@ jobs:
pip install jupyter_core jupyter-packaging
pip install --pre ipyvue ipyvuetify
pip freeze --exclude solara --exclude solara-ui --exclude solara-server --exclude pytest-ipywidgets --exclude solara-enterprise > ${{ env.LOCK_FILE_LOCATION }}
git diff --exit-code | tee diff-integration-vue3-os${{ matrix.os }}-ipywidgets${{ matrix.ipywidgets_major }}.txt
[ -s diff-integration-vue3-os${{ matrix.os }}-ipywidgets${{ matrix.ipywidgets_major }}.txt ] || echo "HAS_DIFF=true" >> "$GITHUB_OUTPUT"
git diff --exit-code | tee ${{ env.DIFF_FILE_LOCATION }}
[ -s ${{ env.DIFF_FILE_LOCATION }} ] || echo "HAS_DIFF=true" >> "$GITHUB_OUTPUT"
- name: Install
if: github.event_name != 'schedule' && steps.prepare.outputs.LOCKS_EXIST == 'true'
Expand Down Expand Up @@ -437,7 +440,7 @@ jobs:
name: test-results-integration-vue3-os${{ matrix.os }}-ipywidgets${{ matrix.ipywidgets_major }}
path: |
test-results
diff-integration-vue3-os${{ matrix.os }}-ipywidgets${{ matrix.ipywidgets_major }}.txt
${{ env.DIFF_FILE_LOCATION }}
./**/${{ env.LOCK_FILE_LOCATION }}
- name: Upload CI package locks
Expand Down Expand Up @@ -467,6 +470,7 @@ jobs:
ipywidgets: "8.0"
env:
LOCK_FILE_LOCATION: .ci-package-locks/unit/os${{ matrix.os }}-python${{ matrix.python }}-ipywidgets${{ matrix.ipywidgets }}.txt
DIFF_FILE_LOCATION: diff-unit-os${{ matrix.os }}-python${{ matrix.python }}-ipywidgets${{ matrix.ipywidgets }}.txt

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -502,8 +506,8 @@ jobs:
pip install `echo packages/solara-enterprise/dist/*.whl`[ssg,auth]
pip install "jupyterlab<4" diskcache redis "ipywidgets~=${{ matrix.ipywidgets }}"
pip freeze --exclude solara --exclude solara-ui --exclude solara-server --exclude pytest-ipywidgets --exclude solara-enterprise > ${{ env.LOCK_FILE_LOCATION }}
git diff --exit-code | tee diff-unit-os${{ matrix.os }}-python${{ matrix.python }}-ipywidgets${{ matrix.ipywidgets }}.txt
[ -s diff-unit-os${{ matrix.os }}-python${{ matrix.python }}-ipywidgets${{ matrix.ipywidgets }}.txt ] || echo "HAS_DIFF=true" >> "$GITHUB_OUTPUT"
git diff --exit-code | tee ${{ env.DIFF_FILE_LOCATION }}
[ -s ${{ env.DIFF_FILE_LOCATION }} ] || echo "HAS_DIFF=true" >> "$GITHUB_OUTPUT"
- name: Install
if: github.event_name != 'schedule' && steps.prepare.outputs.LOCKS_EXIST == 'true'
Expand Down Expand Up @@ -532,7 +536,7 @@ jobs:
with:
name: test-results-unit-os${{ matrix.os }}-python${{ matrix.python }}-ipywidgets${{ matrix.ipywidgets }}
path: |
diff-unit-os${{ matrix.os }}-python${{ matrix.python }}-ipywidgets${{ matrix.ipywidgets }}.txt
${{ env.DIFF_FILE_LOCATION }}
./**/${{ env.LOCK_FILE_LOCATION }}
- name: Upload CI package locks
Expand Down

0 comments on commit ce7a9d9

Please sign in to comment.