Add frontend e2e tests to gh workflow #909
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Lint & Unit Tests for s3gw UI | |
on: | |
push: | |
branches: | |
- "*" | |
pull_request: | |
branches: | |
- "*" | |
jobs: | |
frontend-lint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout s3gw UI | |
uses: actions/checkout@v3 | |
- name: Set up node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
cache: npm | |
cache-dependency-path: src/frontend/package-lock.json | |
- name: Install Dependencies | |
working-directory: src/frontend | |
run: npm ci | |
- name: Run Lint | |
working-directory: src/frontend | |
run: npm run lint | |
frontend-test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout s3gw UI | |
uses: actions/checkout@v3 | |
- name: Set up node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
cache: npm | |
cache-dependency-path: src/frontend/package-lock.json | |
- name: Install Dependencies | |
working-directory: src/frontend | |
run: npm ci | |
- name: Run Unit Tests | |
working-directory: src/frontend | |
run: npm run test:ci | |
frontend-test-e2e: | |
runs-on: ubuntu-latest | |
services: | |
s3gw: | |
image: quay.io/s3gw/s3gw:latest | |
ports: | |
- 7480:7480 | |
steps: | |
- name: Checkout s3gw UI | |
uses: actions/checkout@v3 | |
- name: Setup and run UI Backend | |
run: | | |
cd src \ | |
&& python3 -m venv venv \ | |
&& . venv/bin/activate \ | |
&& pip install -r requirements.txt -r requirements-dev.txt \ | |
&& . venv/bin/activate \ | |
&& mkdir -p frontend/dist/s3gw-ui/assets \ | |
&& touch frontend/dist/s3gw-ui/assets/app-main.config.json \ | |
&& S3GW_DEBUG=1 S3GW_SERVICE_URL=http://127.0.0.1:7480 python3 ./s3gw_ui_backend.py & | |
- name: Set up node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
cache: npm | |
cache-dependency-path: src/frontend/package-lock.json | |
- name: Install Dependencies | |
working-directory: src/frontend | |
run: | | |
cp proxy.conf.json.sample proxy.conf.json | |
npm ci | |
- name: Run E2E Tests | |
working-directory: src/frontend | |
run: npm run e2e:ci | |
backend-lint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout s3gw UI | |
uses: actions/checkout@v3 | |
- name: Install Python 3.10 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
cache: "pip" | |
- name: Install tox | |
run: pip install tox | |
- name: Check code format | |
working-directory: src | |
run: tox -e lint | |
backend-types: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout s3gw UI | |
uses: actions/checkout@v3 | |
- name: Install Python 3.10 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
cache: "pip" | |
- name: Install tox | |
run: pip install tox | |
- name: Check types | |
working-directory: src | |
run: tox -e types | |
backend-unit-tests: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout s3gw UI | |
uses: actions/checkout@v3 | |
- name: Set up node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
cache: npm | |
cache-dependency-path: src/frontend/package-lock.json | |
- name: Install Dependencies | |
working-directory: src/frontend | |
run: npm ci | |
- name: Install Python 3.10 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
cache: "pip" | |
- name: Install tox | |
run: pip install tox | |
- name: Build Frontend | |
working-directory: src/frontend | |
run: npx ng build | |
- name: Run unit tests | |
working-directory: src | |
run: tox -e py310 | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@v3 | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |