mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2026-01-18 19:01:29 +00:00
caching added
This commit is contained in:
parent
6547ccaf58
commit
32223d1505
32
.github/workflows/test-e2e.yml
vendored
32
.github/workflows/test-e2e.yml
vendored
@ -60,6 +60,19 @@ jobs:
|
||||
cd backend
|
||||
yarn install
|
||||
yarn build
|
||||
- name: Upload backend build
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: backend-build
|
||||
path: backend/build
|
||||
- name: Cache node_modules
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: |
|
||||
backend/node_modules
|
||||
webapp/node_modules
|
||||
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
|
||||
|
||||
prepare_webapp:
|
||||
name: Prepare webapp
|
||||
runs-on: ubuntu-latest
|
||||
@ -72,6 +85,13 @@ jobs:
|
||||
run: |
|
||||
cp webapp/.env.template webapp/.env || touch webapp/.env
|
||||
(cd webapp && yarn install || true)
|
||||
- name: Cache node_modules
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: |
|
||||
backend/node_modules
|
||||
webapp/node_modules
|
||||
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
|
||||
prepare_cypress:
|
||||
name: Prepare Cypress
|
||||
runs-on: ubuntu-latest
|
||||
@ -125,6 +145,7 @@ jobs:
|
||||
|
||||
- name: Add node_modules/.bin to PATH
|
||||
run: echo "$(pwd)/node_modules/.bin" >> $GITHUB_PATH
|
||||
|
||||
- name: Ensure Cypress CLI is available
|
||||
run: |
|
||||
if ! command -v cypress >/dev/null; then
|
||||
@ -133,11 +154,13 @@ jobs:
|
||||
else
|
||||
echo "✅ Cypress CLI is present"
|
||||
fi
|
||||
|
||||
- name: Setup .env files
|
||||
run: |
|
||||
mkdir -p webapp backend
|
||||
cp webapp/.env.template webapp/.env || touch webapp/.env
|
||||
cp backend/.env.test_e2e backend/.env || touch backend/.env
|
||||
|
||||
- name: Download neo4j image tarball
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
@ -161,12 +184,21 @@ jobs:
|
||||
docker load < /tmp/neo4j.tar
|
||||
docker load < /tmp/backend.tar
|
||||
docker load < /tmp/webapp.tar
|
||||
|
||||
- name: Start system
|
||||
run: |
|
||||
set -e
|
||||
docker compose -f docker-compose.yml -f docker-compose.test.yml up --detach webapp mailserver
|
||||
- name: Wait for webapp
|
||||
|
||||
run: |
|
||||
for i in {1..30}; do curl -sf http://localhost:3000 && exit 0 || sleep 2; done; exit 1
|
||||
|
||||
- name: Download backend build
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: backend-build
|
||||
path: backend/build
|
||||
|
||||
- name: Run Cypress tests
|
||||
run: yarn run cypress:run --spec $(cypress/parallel-features.sh ${{ matrix.job }} ${{ env.jobs }})
|
||||
Loading…
x
Reference in New Issue
Block a user