-
-
Notifications
You must be signed in to change notification settings - Fork 356
90 lines (74 loc) · 2.81 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
83
84
85
86
87
88
89
90
# 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: "33 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@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
# 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;
- name: Cache conda
uses: actions/cache@3624ceb22c1c5a301c8db4169662070a689d9ea8 # v4.1.1
env:
# Increase this value to reset cache if environment.yml has not changed
CACHE_NUMBER: 0
with:
path: ~/conda_pkgs_dir
key:
${{ runner.os }}-${{ matrix.python-version }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('environment.yml') }}
# create the conda env
- uses: conda-incubator/setup-miniconda@a4260408e20b96e80095f42ff7f1a15b27dd94ca # v3.0.4
with:
python-version: ${{ matrix.python-version }}
auto-update-conda: true
channels: conda-forge
channel-priority: true
activate-environment: data_viz_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