diff --git a/.github/scripts/start-api b/.github/scripts/start-api new file mode 100755 index 00000000..49ecde6a --- /dev/null +++ b/.github/scripts/start-api @@ -0,0 +1,9 @@ +#!/usr/bin/bash + +set -eu + +exec > >(awk '{ print strftime("\033[0;36mYLITSE-API:\033[0m"), $0 }') 2>&1 + +cd ylitse-api +source env/bin/activate +YLITSE_POSTGRES_DATA= make run-gunicorn diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index fb3c7053..6ef8592d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,11 +10,34 @@ jobs: - name: Set up node uses: actions/setup-node@v3 with: - node-version: 16.x - cache: 'npm' + node-version: '16.x' + cache: npm - name: Install deps run: npm ci - name: Lint run: npm run lint - name: Run unit tests run: npm run test:unit + - name: Clone the back end + run: git clone https://gitlab.com/ylitse/ylitse-api + - name: Set up python + uses: actions/setup-python@v4 + with: + python-version: '3.10' + cache: pip + cache-dependency-path: ylitse-api/requirements.txt + - name: Set up the back end + run: make env && . env/bin/activate && make conf + working-directory: ylitse-api + env: + YLITSE_POSTGRES_URL: ${{ secrets.YLITSE_POSTGRES_URL }} + - name: Run E2E tests + uses: cypress-io/github-action@v6 + with: + config: baseUrl=http://localhost:8082 + start: | + ${{ github.workspace }}/.github/scripts/start-api + npm run start + wait-on: 'http://localhost:8080/version, http://localhost:8082' + env: + DEBUG: '@cypress/github-action' diff --git a/package-lock.json b/package-lock.json index 7527933d..3d3e415c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -59,7 +59,7 @@ "react-test-renderer": "^18.2.0", "ts-loader": "^8.4.0", "typescript": "^4.7.4", - "webpack": "^5.73.0", + "webpack": "^5.76.0", "webpack-cli": "^4.10.0", "webpack-dev-server": "^4.9.2" } diff --git a/package.json b/package.json index 049d28c1..5b673554 100644 --- a/package.json +++ b/package.json @@ -67,7 +67,7 @@ "react-test-renderer": "^18.2.0", "ts-loader": "^8.4.0", "typescript": "^4.7.4", - "webpack": "^5.73.0", + "webpack": "^5.76.0", "webpack-cli": "^4.10.0", "webpack-dev-server": "^4.9.2" }, diff --git a/webpack.config.js b/webpack.config.js index 9d065c9c..f6d839ec 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -23,6 +23,7 @@ const DEV_API = process.env.DEV_API module.exports = { devServer: { + port: 8082, historyApiFallback: { verbose: true, },