mirror of
https://github.com/directus/directus.git
synced 2026-02-11 21:05:25 -05:00
* Fix check for changed files & reformat workflows * Test performance of paths-filter action * Revise workflows * Better wording * Fix naming of "Pre-Check" * Point out values * Abreviate to make it look cleaner in report
65 lines
1.6 KiB
YAML
65 lines
1.6 KiB
YAML
name: End-to-End Tests
|
|
|
|
on:
|
|
workflow_call:
|
|
|
|
jobs:
|
|
test:
|
|
name: Test
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
db:
|
|
- mssql
|
|
- mysql
|
|
- postgres
|
|
- maria
|
|
# - sqlite3
|
|
node-version:
|
|
# - 12-alpine
|
|
# - 14-alpine
|
|
- 16-alpine
|
|
env:
|
|
CACHED_IMAGE: ghcr.io/directus/directus-e2e-test-cache:${{ matrix.node-version }}
|
|
steps:
|
|
- name: Login to GitHub container registry
|
|
uses: docker/login-action@v1
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.repository_owner }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Pull cached test image
|
|
run: |
|
|
docker pull $CACHED_IMAGE || true
|
|
docker tag $CACHED_IMAGE directus-test-image || true
|
|
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v2
|
|
with:
|
|
node-version: '16'
|
|
cache: npm
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
- name: Build
|
|
run: npm run build
|
|
|
|
- name: Run tests
|
|
env:
|
|
TEST_NODE_VERSION: ${{ matrix.node-version }}
|
|
TEST_DB: ${{ matrix.db }}
|
|
run: npm run test:e2e
|
|
|
|
- name: Push updated test image
|
|
# Only push the new cache image on the main branch once per node version
|
|
if: github.ref == 'refs/heads/main' && github.repository == 'directus/directus' && matrix.db == 'postgres'
|
|
run: |
|
|
docker tag directus-test-image $CACHED_IMAGE
|
|
docker push $CACHED_IMAGE || true
|