Skip to content

Commit

Permalink
Use a proxy and run matrix jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
Luke Brody committed Aug 16, 2024
1 parent 075497b commit f1c55f5
Show file tree
Hide file tree
Showing 6 changed files with 452 additions and 67 deletions.
44 changes: 41 additions & 3 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ jobs:
working-directory: react
- run: npx eslint .
working-directory: react

build-and-push-image:
runs-on: ubuntu-22.04
outputs:
Expand Down Expand Up @@ -50,12 +51,49 @@ jobs:
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=registry,ref=${{ steps.meta.outputs.tags }}
cache-to: type=inline
e2e:

build-frontend:
runs-on: ubuntu-22.04
needs: build-and-push-image
container:
image: ghcr.io/${{ needs.build-and-push-image.outputs.image_tag }}
steps:
- uses: actions/checkout@v4
- run: git clone --progress --depth 1 https://github.com/densitydb/densitydb.github.io.git /density-db
- run: $GITHUB_WORKSPACE/test-ci.sh
- run: python3 create_website.py react/test/density-db --no-data --no-geo --no-juxta
- uses: actions/upload-artifact@v4
with:
name: frontend-build
path: react/test/density-db

list-e2e-tests:
runs-on: ubuntu-22.04
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v4
- id: set-matrix
run: echo "matrix=$(ls ./test/**/*_test.js | jq -R -s -c 'split("\n")[:-1]')" >> $GITHUB_OUTPUT
working-directory: react

run-e2e-tests:
runs-on: ubuntu-22.04
needs: [build-and-push-image, list-e2e-tests]
container:
image: ghcr.io/${{ needs.build-and-push-image.outputs.image_tag }}
strategy:
matrix:
test-file: ${{ fromJson(needs.list-e2e-tests.outputs.matrix) }}
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: frontend-build
- run: |
# Start display subsystem to browser can run
Xvfb :10 -ac &
export DISPLAY=:10
fluxbox >/dev/null 2>&1 & # needed for window resizing in Testcafe
- run: |
npx ts-node test/ci_proxy.ts &
npx testcafe -e chromium ${{ matrix.test-file }}
working-directory: react
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ dist
.vscode
*Copy1.ipynb*
.DS_Store
react/test/density-db
Loading

0 comments on commit f1c55f5

Please sign in to comment.