Compare commits
2 commits
master
...
github_tes
| Author | SHA1 | Date | |
|---|---|---|---|
| 90490a0a7a | |||
|
|
f65547ee7e |
1 changed files with 96 additions and 0 deletions
96
.github/workflows/tests.yml
vendored
Normal file
96
.github/workflows/tests.yml
vendored
Normal file
|
|
@ -0,0 +1,96 @@
|
|||
# This module is part of CARA. Please see the repository at
|
||||
# https://gitlab.cern.ch/cara/cara for details of the license and terms of use.
|
||||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- 'feature/*'
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
- 'feature/*'
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
reason:
|
||||
description: 'Reason'
|
||||
required: false
|
||||
default: 'Manual trigger'
|
||||
|
||||
jobs:
|
||||
test-install:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
PROJECT_ROOT: ./
|
||||
PROJECT_NAME: cara
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
lfs: true
|
||||
|
||||
- name: Create LFS file list
|
||||
run: git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id
|
||||
|
||||
- name: Restore LFS cache
|
||||
uses: actions/cache@v2
|
||||
id: lfs-cache
|
||||
with:
|
||||
path: .git/lfs
|
||||
key: ${{ runner.os }}-lfs-${{ hashFiles('.lfs-assets-id') }}-v1
|
||||
|
||||
- name: Git LFS Pull
|
||||
run: git lfs pull
|
||||
|
||||
- name: Set up Python 3.9
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: 3.9
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install ${PROJECT_ROOT}[test]
|
||||
|
||||
- name: Run tests
|
||||
run: |
|
||||
mkdir -p ~/not-the-source-dir && cd ~/not-the-source-dir
|
||||
python -m pytest --pyargs ${PROJECT_NAME}
|
||||
test-dev:
|
||||
runs-on: ubuntu-20.04
|
||||
env:
|
||||
PROJECT_ROOT: ./
|
||||
PROJECT_NAME: cara
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
lfs: true
|
||||
|
||||
- name: Create LFS file list
|
||||
run: git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id
|
||||
|
||||
- name: Restore LFS cache
|
||||
uses: actions/cache@v2
|
||||
id: lfs-cache
|
||||
with:
|
||||
path: .git/lfs
|
||||
key: ${{ runner.os }}-lfs-${{ hashFiles('.lfs-assets-id') }}-v1
|
||||
|
||||
- name: Git LFS Pull
|
||||
run: git lfs pull
|
||||
|
||||
- name: Set up Python 3.9
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: 3.9
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install -e ${PROJECT_ROOT}[test]
|
||||
python -m pip install pytest-cov
|
||||
|
||||
- name: Run tests
|
||||
run: |
|
||||
cd ${PROJECT_ROOT}
|
||||
python -m pytest ./${PROJECT_NAME} --cov=${PROJECT_NAME} --junitxml=report.xml
|
||||
Loading…
Reference in a new issue