-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (34 loc) · 1007 Bytes
/
ci.yml
File metadata and controls
40 lines (34 loc) · 1007 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
name: CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
setup:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
fail-fast: false
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Read environment name from environment.yml
id: env-name
shell: python
run: |
import re, os
with open("environment.yml") as f:
for line in f:
match = re.match(r"^name:\s*(\S+)", line)
if match:
with open(os.environ["GITHUB_OUTPUT"], "a") as out:
out.write(f"env_name={match.group(1)}\n")
break
- name: Set up Conda
uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: ${{ steps.env-name.outputs.env_name }}
environment-file: environment.yml
auto-activate-base: false