|
| 1 | +# This workflow builds the workshop environment on Mac, Linux, and Windows for |
| 2 | +# multiple versions of Python to confirm it can be properly installed. |
| 3 | +# |
| 4 | +# Author: Stefanie Molin |
| 5 | + |
| 6 | +name: Env Build |
| 7 | + |
| 8 | +# Controls when the workflow will run |
| 9 | +on: |
| 10 | + # Triggers the workflow on push events |
| 11 | + push: |
| 12 | + branches: [ "main" ] |
| 13 | + |
| 14 | + # Trigger on pull request always (note the trailing colon) |
| 15 | + pull_request: |
| 16 | + |
| 17 | + # Allows you to run this workflow manually from the Actions tab |
| 18 | + workflow_dispatch: |
| 19 | + |
| 20 | + # Run this every month |
| 21 | + schedule: |
| 22 | + - cron: "44 22 11 * *" |
| 23 | + |
| 24 | +# A workflow run is made up of one or more jobs that can run sequentially or in parallel |
| 25 | +jobs: |
| 26 | + # This workflow contains a single job called "build" |
| 27 | + build: |
| 28 | + name: Python ${{ matrix.python-version }}, ${{ matrix.os }} |
| 29 | + |
| 30 | + # The type of runner that the job will run on |
| 31 | + runs-on: ${{ matrix.os }} |
| 32 | + |
| 33 | + defaults: |
| 34 | + run: |
| 35 | + shell: bash -el {0} |
| 36 | + |
| 37 | + strategy: |
| 38 | + fail-fast: false |
| 39 | + matrix: |
| 40 | + os: [macos-latest, ubuntu-latest, windows-latest] |
| 41 | + python-version: ["3.8", "3.9", "3.10", "3.11"] |
| 42 | + |
| 43 | + # Steps represent a sequence of tasks that will be executed as part of the job |
| 44 | + steps: |
| 45 | + # checks-out your repository under $GITHUB_WORKSPACE, so your job can access it |
| 46 | + - uses: actions/checkout@v3 |
| 47 | + |
| 48 | + # remove the Python version from the file for testing |
| 49 | + - name: strip hardcoded Python version from environment for testing |
| 50 | + run: | |
| 51 | + if [[ ${{ matrix.os }} == "macos"* ]]; then |
| 52 | + sed -i '' -e '/- python=/d' environment.yml; |
| 53 | + else |
| 54 | + sed -i -e '/- python=/d' environment.yml; |
| 55 | + fi; |
| 56 | +
|
| 57 | + # create the conda env |
| 58 | + - uses: conda-incubator/setup-miniconda@v2 |
| 59 | + with: |
| 60 | + python-version: ${{ matrix.python-version }} |
| 61 | + auto-update-conda: true |
| 62 | + miniforge-variant: Mambaforge |
| 63 | + use-mamba: true |
| 64 | + channel-priority: true |
| 65 | + activate-environment: pandas_workshop |
| 66 | + environment-file: environment.yml |
| 67 | + |
| 68 | + - name: conda diagnostics |
| 69 | + run: | |
| 70 | + conda info |
| 71 | + conda list |
| 72 | + conda config --show-sources |
| 73 | + conda config --show |
| 74 | + printenv | sort |
| 75 | +
|
| 76 | + - name: verify install |
| 77 | + run: cd notebooks && python check_env.py |
| 78 | + |
0 commit comments