Skip to content

Commit

Permalink
Merge branch 'corpus-dev' into fix-506
Browse files Browse the repository at this point in the history
  • Loading branch information
pmeier authored Dec 20, 2024
2 parents 4385843 + 9666b00 commit 2ee510a
Show file tree
Hide file tree
Showing 85 changed files with 3,416 additions and 3,334 deletions.
26 changes: 11 additions & 15 deletions .github/actions/setup-env/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,22 @@ runs:
using: composite

steps:
- name: Setup mambaforge and development environment
- name: Setup miniforge and empty development environment
uses: conda-incubator/setup-miniconda@v3
with:
miniforge-variant: Mambaforge
miniforge-version: latest
activate-environment: ragna-dev

- name: Display conda info
shell: bash -el {0}
shell: bash -elo pipefail {0}
run: conda info

- name: Set cache date
id: cache-key
shell: bash
run: |
DATE=$(date +'%Y%m%d')
echo $DATE
echo "DATE=$DATE" >> $GITHUB_OUTPUT
echo "date=${DATE}" | tee -a "${GITHUB_OUTPUT}"
- name: Restore conda environment
id: cache
Expand All @@ -41,33 +39,31 @@ runs:
env-${{ runner.os }}-${{ runner.arch }}-${{ inputs.python-version
}}|${{steps.cache-key.outputs.date }}-${{ hashFiles('environment-dev.yml',
'pyproject.toml') }}
restore-keys: |
env-${{ runner.os }}-${{ runner.arch }}-${{ inputs.python-version }}

- name: Update conda environment if necessary
if: steps.cache.outputs.cache-hit != 'true'
shell: bash
shell: bash -elo pipefail {0}
run: |
sed -i'' -e 's/python *= *[0-9.]\+/python =${{ inputs.python-version }}/g' environment-dev.yml
cat environment-dev.yml
mamba env update --file environment-dev.yml
conda env update --quiet --file environment-dev.yml
git checkout -- environment-dev.yml
- name: Install playwright
shell: bash -el {0}
run: playwright install
# - name: Install playwright
# shell: bash -el {0}
# run: playwright install

- name: Install ragna
shell: bash -el {0}
shell: bash -elo pipefail {0}
run: |
if [[ ${{ inputs.optional-dependencies }} == true ]]
then
PROJECT_PATH='.[all]'
else
PROJECT_PATH='.'
fi
pip install --editable "${PROJECT_PATH}"
pip install --verbose --progress-bar=off --editable "${PROJECT_PATH}"
- name: Display development environment
shell: bash -el {0}
shell: bash -elo pipefail {0}
run: conda list
2 changes: 1 addition & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -el {0}
shell: bash -elo pipefail {0}

steps:
- name: Checkout repository
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -el {0}
shell: bash -elo pipefail {0}

steps:
- name: Checkout repository
Expand All @@ -33,7 +33,7 @@ jobs:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -el {0}
shell: bash -elo pipefail {0}

steps:
- name: Checkout repository
Expand Down Expand Up @@ -63,7 +63,7 @@ jobs:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -el {0}
shell: bash -elo pipefail {0}

steps:
- name: Checkout repository
Expand Down
135 changes: 66 additions & 69 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -el {0}
shell: bash -elo pipefail {0}

steps:
- name: Checkout repository
Expand Down Expand Up @@ -53,7 +53,7 @@ jobs:

defaults:
run:
shell: bash -el {0}
shell: bash -elo pipefail {0}

steps:
- name: Checkout repository
Expand All @@ -70,76 +70,73 @@ jobs:
id: tests
run: |
pytest \
--ignore tests/deploy/ui \
--junit-xml=test-results.xml \
--durations=25
--ignore tests/deploy/ui \
--junit-xml=test-results.xml \
--durations=25
- name: Surface failing tests
if: steps.tests.outcome != 'success'
uses: pmeier/[email protected]
with:
path: test-results.xml

pytest-ui:
strategy:
# FIXME: the matrix is currently limited due to our UI tests currently only being
# minimal smoke tests. No need to waste CI resources.
matrix:
os:
- ubuntu-latest
# - windows-latest
# - macos-latest
browser:
- chromium
# - firefox
python-version:
- "3.10"
# - "3.10"
# - "3.12"
# exclude:
# - python-version: "3.11"
# os: windows-latest
# - python-version: "3.12"
# os: windows-latest
# - python-version: "3.11"
# os: macos-latest
# - python-version: "3.12"
# os: macos-latest
# include:
# - browser: webkit
# os: macos-latest
# python-version: "3.10"

fail-fast: false

runs-on: ${{ matrix.os }}

defaults:
run:
shell: bash -el {0}

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup environment
uses: ./.github/actions/setup-env
with:
python-version: ${{ matrix.python-version }}

- name: Run unit tests
id: tests
run: |
pytest tests/deploy/ui \
--browser ${{ matrix.browser }} \
--video=retain-on-failure
- name: Upload playwright video
if: failure()
uses: actions/upload-artifact@v4
with:
name:
playwright-${{ matrix.os }}-${{ matrix.python-version}}-${{ github.run_id }}
path: test-results
# pytest-ui:
# strategy:
# matrix:
# os:
# - ubuntu-latest
# - windows-latest
# - macos-latest
# browser:
# - chromium
# - firefox
# python-version:
# - "3.10"
# - "3.10"
# - "3.12"
# exclude:
# - python-version: "3.11"
# os: windows-latest
# - python-version: "3.12"
# os: windows-latest
# - python-version: "3.11"
# os: macos-latest
# - python-version: "3.12"
# os: macos-latest
# include:
# - browser: webkit
# os: macos-latest
# python-version: "3.10"
#
# fail-fast: false
#
# runs-on: ${{ matrix.os }}
#
# defaults:
# run:
# shell: bash -elo pipefail {0}
#
# steps:
# - name: Checkout repository
# uses: actions/checkout@v4
# with:
# fetch-depth: 0
#
# - name: Setup environment
# uses: ./.github/actions/setup-env
# with:
# python-version: ${{ matrix.python-version }}
#
# - name: Run unit tests
# id: tests
# run: |
# pytest tests/deploy/ui \
# --browser ${{ matrix.browser }} \
# --video=retain-on-failure
#
# - name: Upload playwright video
# if: failure()
# uses: actions/upload-artifact@v4
# with:
# name:
# playwright-${{ matrix.os }}-${{ matrix.python-version}}-${{ github.run_id }}
# path: test-results
2 changes: 1 addition & 1 deletion .github/workflows/update-docker-requirements.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -el {0}
shell: bash -elo pipefail {0}

steps:
- name: Checkout repository
Expand Down
Loading

0 comments on commit 2ee510a

Please sign in to comment.