@@ -2,41 +2,58 @@ name: test
22
33on : push
44
5+ env :
6+ E2E_DATAVERSE_IMAGE_TAG : unstable
7+
58jobs :
6- # Temporarily commented out, until we set up a suitable e2e environment for running GitHub actions
7- # e2e:
8- # runs-on: ubuntu-latest
9- # environment: e2e
10-
11- # steps:
12- # - uses: actions/checkout@v3
13-
14- # - uses: actions/setup-node@v3
15- # with:
16- # node-version: 18
17- # cache: 'npm'
18-
19- # - name: Install Dependencies
20- # run: npm install
21-
22- # - name: Build Dataverse Design System
23- # working-directory: packages/design-system
24- # run: npm run build
25-
26- # - name: Create and populate .env file
27- # env:
28- # DATAVERSE_BACKEND_URL: ${{ secrets.DATAVERSE_BACKEND_URL }}
29- # run: |
30- # touch .env
31- # echo VITE_DATAVERSE_BACKEND_URL="$DATAVERSE_BACKEND_URL" >> .env
32- # shell: bash
33-
34- # - name: Cypress run
35- # uses: cypress-io/github-action@v5
36- # with:
37- # build: npm run build
38- # start: npm run preview
39- # wait-on: 'npx wait-on --timeout 60000 http://localhost:5173'
9+ e2e :
10+ runs-on : ubuntu-latest
11+
12+ steps :
13+ - uses : actions/checkout@v3
14+
15+ - uses : actions/setup-node@v3
16+ with :
17+ node-version : 18
18+ cache : ' npm'
19+
20+ - name : Create .npmrc
21+ run : |
22+ cp .npmrc.example .npmrc
23+ sed -i -e 's/<YOUR_GITHUB_AUTH_TOKEN>/${{ secrets.GITHUB_TOKEN }}/g' .npmrc
24+ sed -i -e 's/<YOUR_NPM_AUTH_TOKEN>/${{ secrets.NPM_AUTH_TOKEN }}/g' .npmrc
25+
26+ - name : Install Dependencies
27+ run : npm install
28+
29+ - name : Build Dataverse Design System
30+ working-directory : packages/design-system
31+ run : npm run build
32+
33+ - name : Create and populate .env file
34+ env :
35+ DATAVERSE_BACKEND_URL : ' http://localhost:8000'
36+ run : |
37+ touch .env
38+ echo VITE_DATAVERSE_BACKEND_URL="$DATAVERSE_BACKEND_URL" >> .env
39+ shell : bash
40+
41+ - name : Update registry for the containerized development environment
42+ working-directory : dev-env
43+ run : |
44+ sed -i~ '/^REGISTRY=/s/=.*/=docker.io/' .env
45+ shell : bash
46+
47+ - name : Start containers
48+ working-directory : dev-env
49+ run : ./run-env.sh "$E2E_DATAVERSE_IMAGE_TAG"
50+
51+ - name : Wait for containers to be ready
52+ run : timeout 300s sh -c 'while ! docker logs dev_dataverse_bootstrap 2>&1 | grep -q "your instance has been configured"; do sleep 2; done'
53+
54+ - name : Run e2e tests
55+ run : npm run test:e2e
56+
4057 component :
4158 runs-on : ubuntu-latest
4259
5269 run : |
5370 cp .npmrc.example .npmrc
5471 sed -i -e 's/<YOUR_GITHUB_AUTH_TOKEN>/${{ secrets.GITHUB_TOKEN }}/g' .npmrc
72+ sed -i -e 's/<YOUR_NPM_AUTH_TOKEN>/${{ secrets.NPM_AUTH_TOKEN }}/g' .npmrc
5573
5674 - name : Install Dependencies
5775 run : npm install
@@ -106,6 +124,7 @@ jobs:
106124 run : |
107125 cp .npmrc.example .npmrc
108126 sed -i -e 's/<YOUR_GITHUB_AUTH_TOKEN>/${{ secrets.GITHUB_TOKEN }}/g' .npmrc
127+ sed -i -e 's/<YOUR_NPM_AUTH_TOKEN>/${{ secrets.NPM_AUTH_TOKEN }}/g' .npmrc
109128
110129 - name : Install Dependencies
111130 run : npm install
0 commit comments