add test_get_cds_with_domains test #189
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
name: CI/CD | |
on: | |
push: | |
branches: | |
- dev | |
- feature/* | |
pull_request: | |
branches: | |
- master | |
- dev | |
jobs: | |
run_pytest: | |
runs-on: ubuntu-latest | |
if: ${{ !contains(github.event.head_commit.message, 'docs') && !contains(github.event.head_commit.message, 'documentation') }} | |
timeout-minutes: 15 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up mamba environment | |
uses: mamba-org/setup-micromamba@v1 | |
with: | |
micromamba-version: '1.3.1-0' | |
environment-file: environment.yml | |
environment-name: BiG-SCAPE | |
init-shell: bash | |
generate-run-shell: true | |
- name: Install dependencies | |
shell: micromamba-shell {0} | |
run: | | |
python -m pip install pytest coverage coverage-badge | |
- name: Test with Pytest | |
shell: micromamba-shell {0} | |
run: | | |
coverage run -m pytest | |
coverage report | |
mkdir badges | |
coverage-badge -o badges/coverage.svg | |
- name: Upload badges folder | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: badges | |
destination_dir: badges | |
keep_files: true | |
run_pylint: | |
runs-on: ubuntu-latest | |
if: ${{ !contains(github.event.head_commit.message, 'docs') && !contains(github.event.head_commit.message, 'documentation') }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up python | |
uses: actions/setup-python@main | |
with: | |
python-version: "3.9" | |
- name: Install dependencies | |
shell: bash | |
run: python -m pip install pylint anybadge | |
- name: Run pylint | |
shell: bash | |
run: | | |
score=$(pylint bigscape.py --exit-zero | grep 'rated at' | sed -r 's/^.*at ([0-9]+\.[0-9]+).*$/\1/') | |
echo $score | |
mkdir badges | |
rm -f badges/pylint.svg | |
anybadge -l pylint -v $score -f badges/pylint.svg 2=red 4=orange 8=yellow 10=green | |
- name: Save badge to cache | |
uses: actions/cache/save@v3 | |
with: | |
path: badges | |
key: cache-${{ github.run_id }}-${{ github.run_attempt }} | |
- name: Upload badges folder | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: badges | |
destination_dir: badges | |
keep_files: true | |
# upload_badges: | |
# runs-on: ubuntu-latest | |
# if: ${{ !contains(github.event.head_commit.message, 'docs') && !contains(github.event.head_commit.message, 'documentation') }} | |
# needs: | |
# - run_pytest | |
# - run_pylint | |
# steps: | |
# - name: Setup cache | |
# uses: actions/cache/restore@v3 | |
# with: | |
# path: badges | |
# key: cache-${{ github.run_id }}-${{ github.run_attempt }} | |
# - name: Check cache hit | |
# if: steps.cache.outputs.cache-hit != 'true' | |
# run: | | |
# Could not find cache | |
# exit 1 | |
# - name: LS badges dir | |
# shell: bash | |
# run: | | |
# ls -l | |
# ls -l badges | |
# - name: Upload badges folder | |
# uses: peaceiris/actions-gh-pages@v3 | |
# with: | |
# github_token: ${{ secrets.GITHUB_TOKEN }} | |
# publish_dir: badges | |
# destination_dir: badges |