Skip to content

update snyk action #478

update snyk action

update snyk action #478

Workflow file for this run

name: CI
on: [push]
jobs:
miniconda:
name: Setup and test
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ["ubuntu-latest"]
steps:
- uses: actions/checkout@v4
- uses: snyk/actions/setup@master
- uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: test
environment-file: environment.yml
python-version: 3.9
use-mamba: true
auto-activate-base: true
- shell: bash -l {0}
run: |
conda info
conda list
- name: Install earthspy
shell: bash -l {0}
run: |
pip install -e .
- name: Checkout code
uses: actions/checkout@v4
with:
# Full git history is needed to get a proper list of changed files within `super-linter`
fetch-depth: 0
- name: Lint code base
uses: github/super-linter/slim@v4.9.0
env:
VALIDATE_ALL_CODEBASE: true
VALIDATE_JSON: true
VALIDATE_YAML: true
DEFAULT_BRANCH: main
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run tests and generate coverage report
shell: bash -l {0}
run: |
pip install pytest
pip install pytest-cov
pytest --cov --junitxml=junit.xml -o junit_family=legacy
env:
SH_CLIENT_ID: ${{ secrets.SH_CLIENT_ID }}
SH_CLIENT_SECRET: ${{ secrets.SH_CLIENT_SECRET }}
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/test-results-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: Run Snyk to check for vulnerabilities
continue-on-error: true
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}