Lock conda-pack because newer versions break builds (#345) #1631
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
# This workflow will install Python dependencies, run tests, lint, and perform static code analysis | |
# All unit tests found in the tests/ directory are run. | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | |
name: Run tests | |
on: push | |
jobs: | |
linting-flake8: | |
name: Lint Python with flake8 | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout github repo | |
uses: actions/checkout@v2 | |
- name: Install flake8 | |
run: | | |
python -m pip install flake8 | |
- name: Run lint with flake8 | |
run: | | |
flake8 src --show-source --count --statistics --max-line-length=120 | |
linting-js: | |
name: Lint Front-end application | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./visualisation | |
steps: | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 16.x | |
- uses: actions/checkout@v3 | |
- name: Install dependencies | |
run: npm ci | |
- name: Run linting | |
run: npm run lint | |
unit-tests: | |
name: Run unit tests with pytest | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
shell: bash -l {0} | |
steps: | |
- name: Checkout github repo including lfs files | |
uses: actions/checkout@v2 | |
with: | |
lfs: true | |
- name: Install package dependencies | |
uses: mamba-org/setup-micromamba@v1 | |
with: | |
environment-file: environment.yml | |
# only cache environment | |
cache-environment: true | |
cache-downloads: false | |
- run: | | |
conda info | |
conda list | |
conda config --show-sources | |
conda config --show | |
- name: Create .env file with API keys | |
env: | |
ENV_BASE64: ${{ secrets.ENV_BASE64 }} | |
run: | | |
echo import .env file from secrets and regenerate the file | |
echo $ENV_BASE64 | base64 -d > .env | |
- name: Run tests with pytest | |
env: | |
TEST_DATABASE_INTEGRATION: "false" | |
run: | | |
pytest | |
sonarcloud: | |
name: Run static-code analysis on SonarCloud | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout github repo | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: SonarCloud Scan | |
uses: SonarSource/sonarcloud-github-action@master | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |