Merge pull request #18 from OnnoKampman/add-extracted-features #73
This file contains hidden or 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: Pytest | |
| # Run Pytest only on pushes to main branch and to pull requests into main branch. | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.11"] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| # - name: Switch to Current Branch | |
| # run: git checkout ${{ env.BRANCH }} | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v3 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install R | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y r-base r-base-dev | |
| - name: Install Python and R dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r tests_requirements.txt | |
| sudo apt-get install libmpfr-dev libmpfr-doc | |
| sudo Rscript -e 'install.packages("rmgarch", repos="https://cloud.r-project.org")' | |
| # pip install -e . | |
| # Coverage report is both printed to the console and saved as an XML file. | |
| - name: Run unit tests | |
| run: | | |
| python -m pytest --cov=./fcest --cov-report=term --cov-report=xml --import-mode=append ./tests | |
| echo "$(python -m pytest --cov=./fcest --cov-report=xml | grep -oP '(?<=<report\s+.*\s+line-rate=")\d+(\.\d+)?')" | |
| # echo "$(pytest --cov=./fcest --cov-report=xml | grep -oP '(?<=<report\s+.*\s+line-rate=")\d+(\.\d+)?')" > coverage_percentage.txt | |
| # - name: Set Coverage Percentage | |
| # id: set_coverage | |
| # run: echo "::set-output name=coverage::$(pytest --cov=./fcest --cov-report=xml | grep -oP '(?<=<report\s+.*\s+line-rate=")\d+(\.\d+)?')" |