Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove cypress and coverage from ci #251

Merged
merged 2 commits into from
Oct 27, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
117 changes: 0 additions & 117 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,125 +57,8 @@ jobs:
PGPORT: ${{ job.services.postgres.ports[5432] }}
PGUSER: postgres
PGPASSWORD: postgres
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
run: |
bash scripts/test.sh
bash <(curl -s https://codecov.io/bash)

cypress:
name: Run integration tests using cypress
runs-on: ubuntu-latest

services:
postgres:
image: postgres
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: yacs
ports:
- 5432/tcp
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5

steps:
- uses: actions/checkout@v2

- name: Setup database
working-directory: src/data
env:
PGHOST: localhost
PGPORT: ${{ job.services.postgres.ports[5432] }}
PGUSER: postgres
PGPASSWORD: postgres
run: |
bash build.sh

- name: Set up Python 3.8
uses: actions/setup-python@v1
with:
python-version: 3.8

- name: Update pip
run: python -m pip install --upgrade pip

- name: Load cache for pip
uses: actions/cache@v1
with:
path: ~/.cache/pip
key: |
${{ runner.os }}-backend-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-backend-pip-

- name: Install dependencies
run: pip install -r src/api/requirements.txt

- name: Start API
working-directory: src/api
env:
DB_USER: postgres
DB_PASS: postgres
DB_PORT: ${{ job.services.postgres.ports[5432] }}
run: |
python app.py &
curl \
--retry 5 \
--retry-delay 1 \
--retry-connrefused \
http://localhost:5000

- name: Start web
working-directory: src/web
run: |
npm ci
npm run serve:test &

- name: Seed test data
working-directory: rpi_data
run: |
function load_semester() {
curl \
--location \
--request POST \
'http://localhost:8080/api/bulkCourseUpload' \
--form "file=@$1" \
--form 'isPubliclyVisible=true' \
--max-time 60 \
-v
}
load_semester "summer-2020.csv"
load_semester "fall-2020.csv"

- name: Run cypress
uses: cypress-io/github-action@v2
with:
working-directory: tests/integration
wait-on: "http://localhost:8080"

- uses: actions/upload-artifact@v1
if: failure()
with:
name: cypress-screenshots
path: tests/integration/cypress/screenshots
# Test run video was always captured, so this action uses "always()" condition
- uses: actions/upload-artifact@v1
if: always()
with:
name: cypress-videos
path: tests/integration/cypress/videos

- uses: actions/upload-artifact@v1
with:
name: nyc-report
path: tests/integration/coverage/lcov-report

- name: Upload coverage
working-directory: tests/integration
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
run: |
npm run report-coverage
bash <(curl -s https://codecov.io/bash)

test-build:
runs-on: ubuntu-latest
Expand Down