Skip to content

Commit

Permalink
Merge pull request #3466 from architecture-building-systems/use-conda…
Browse files Browse the repository at this point in the history
…-lock

Use conda-lock for tests
  • Loading branch information
reyery authored Jan 23, 2024
2 parents ad5624e + a0fb134 commit 13f404a
Show file tree
Hide file tree
Showing 6 changed files with 24,051 additions and 66 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/conda_lock.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
name: conda-lock

on:
pull_request:
types: [opened, synchronize]
branches: [master]
on: workflow_dispatch

jobs:
test:
Expand Down
40 changes: 38 additions & 2 deletions .github/workflows/pull.request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,57 @@ on:
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 }}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest", "macos-latest", "windows-latest"]

steps:
- uses: actions/checkout@v3

- name: Install Conda environment with Micromamba
uses: mamba-org/setup-micromamba@v1
with:
environment-file: environment.yml
environment-file: conda-lock.yml
environment-name: cea
cache-environment: true

- name: Install CEA
Expand Down
Loading

0 comments on commit 13f404a

Please sign in to comment.