Skip to content

Return empty data even if surroundings file is empty #414

Return empty data even if surroundings file is empty

Return empty data even if surroundings file is empty #414

Workflow file for this run

name: Pull Request Tests
on:
pull_request:
types: [opened, synchronize]
branches: [master]
jobs:
check_environment_yml:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup master branch locally without switching current branch
run: git fetch origin master:master
- name: Check environment.yml diff
id: environment_yml_diff
run: |
set +e
git diff --quiet ..master -- environment.yml
echo "env_diff=$?" >> "$GITHUB_OUTPUT"
- name: Check conda-lock.yml diff
id: conda_lock_yml_diff
run: |
set +e
git diff --quiet ..master -- conda-lock.yml
echo "lock_diff=$?" >> "$GITHUB_OUTPUT"
- uses: actions/github-script@v7
if: ${{ steps.environment_yml_diff.outputs.env_diff != 0 && steps.conda_lock_yml_diff.outputs.lock_diff == 0 }}
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: 'Changes detected in `environment.yml` but `conda-lock.yml` is not updated.'
})
core.setFailed('conda-lock.yml needs to be updated')
build:
name: ${{ matrix.os }}
runs-on: ${{ matrix.os }}
needs: check_environment_yml
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
steps:
- uses: actions/checkout@v4
- name: Install Conda environment with Micromamba
uses: mamba-org/setup-micromamba@v1
with:
environment-file: conda-lock.yml
environment-name: cea
cache-environment: true
- name: Install CEA
shell: bash -l {0}
run: pip install .
- name: Run tests
shell: bash -l {0}
run: cea test --workflow quick