Skip to content

Merge pull request #3 from vietman2/feat/community #27

Merge pull request #3 from vietman2/feat/community

Merge pull request #3 from vietman2/feat/community #27

Workflow file for this run

name: Coverage
on:
push:
branches: ["dev"]
pull_request:
branches: ["dev"]
jobs:
build:
runs-on: ubuntu-latest
env:
SECRET_KEY: ${{ secrets.SECRET_KEY }}
AWS_ACCESS_KEY: "AWS_ACCESS_KEY"
AWS_SECRET_KEY: "AWS_SECRET_KEY"
strategy:
max-parallel: 4
matrix:
python-version: [3.9]
node-version: [18.x]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
cache: 'pipenv'
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
cache-dependency-path: "./sweep/yarn.lock"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
sudo apt-get update
sudo apt-get install -y lcov
pip install pipenv
cd sweepseries
pipenv install --dev
cd ../sweep
yarn install
cd ..
- name: Backend Coverage
run: |
cd sweepseries
pipenv run coverage run --source='.' manage.py test
pipenv run coverage report
pipenv run coverage xml
pipenv run coverage lcov
cd ..
- name: Frontend Coverage
run: |
cd sweep
yarn global add lcov-result-merger
yarn test --coverage --watchAll=false
cp coverage/lcov.info coverage.lcov
cd ..
lcov-result-merger '*/coverage.lcov' coverage.lcov --prepend-source-files --prepend-path-fix "."
- name: Upload coverage to Coveralls
uses: coverallsapp/github-action@v2.2.3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ./coverage.lcov