-
-
Notifications
You must be signed in to change notification settings - Fork 716
83 lines (67 loc) · 2.38 KB
/
env-checks.yml
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# This workflow builds the workshop environment on Mac, Linux, and Windows for
# multiple versions of Python to confirm it can be properly installed.
#
# Author: Stefanie Molin
name: Env Build
# Controls when the workflow will run
on:
# Triggers the workflow on push events
push:
branches: [ "main" ]
# Trigger on pull request always (note the trailing colon)
pull_request:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Run this every month
schedule:
- cron: "44 22 11 * *"
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
name: Python ${{ matrix.python-version }}, ${{ matrix.os }}
# The type of runner that the job will run on
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash -el {0}
strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
python-version: ["3.9", "3.10", "3.11", "3.12"]
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
# remove the Python version from the file for testing
- name: strip hardcoded Python version from environment for testing
run: |
if [[ ${{ matrix.os }} == "macos"* ]]; then
sed -i '' -e '/- python[>=]/d' environment.yml;
else
sed -i -e '/- python[>=]/d' environment.yml;
fi;
# create the conda env
- uses: conda-incubator/setup-miniconda@v3
with:
python-version: ${{ matrix.python-version }}
auto-update-conda: true
miniforge-variant: Mambaforge
mamba-version: "*"
channels: conda-forge
channel-priority: true
activate-environment: pandas_workshop
environment-file: environment.yml
- name: conda diagnostics
run: |
conda info
conda list
conda config --show-sources
conda config --show
printenv | sort
- name: verify install
run: cd notebooks && python check_env.py