tutorials #2130
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CondaBuildWindows | |
on: [push] | |
env: | |
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) | |
BUILD_TYPE: Release | |
GITHUB_WORKFLOW: CondaBuildWindows | |
jobs: | |
build: | |
# The CMake configure and build commands are platform agnostic and should work equally | |
# well on Windows or Mac. You can convert this to a matrix build if you need | |
# cross-platform coverage. | |
# See: https://docs.github.com/en/actions/configuring-and-managing-workflows/configuring-a-workflow#configuring-a-build-matrix | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: ["windows-2022"] | |
python-version: ["3.11"] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.ref }} | |
submodules: 'recursive' | |
- name: Cache conda | |
uses: actions/cache@v4 | |
env: | |
# Increase this value to reset cache if etc/example-environment.yml has not changed | |
CACHE_NUMBER: 0 | |
with: | |
path: ~/conda_pkgs_dir | |
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('.github/macos-environment.yml') }} | |
- uses: conda-incubator/setup-miniconda@v3 | |
with: | |
miniforge-version: latest | |
environment-file: .github/environment.yml | |
activate-environment: tracking | |
python-version: ${{ matrix.python-version }} | |
channels: conda-forge | |
auto-activate-base: true | |
auto-update-conda: true | |
use-only-tar-bz2: true | |
- name: Create .condarc file | |
run: | | |
conda config --show channels | |
echo "channels:" > ~/.condarc | |
echo " - conda-forge" >> ~/.condarc | |
echo "channel_priority: strict" >> ~/.condarc | |
echo "default_channels: []" >> ~/.condarc | |
- name: Verify .condarc content | |
run: | | |
cat ~/.condarc | |
- name: Show current conda channels | |
run: conda config --show channels | |
- name: Build | |
shell: bash -l {0} | |
working-directory: ${{runner.workspace}} | |
run: | | |
echo "::group::Info" | |
conda info | |
conda list | |
conda search numpy | |
echo "::endgroup::" | |
echo "::group::Fix Meta" | |
cd $GITHUB_WORKSPACE/conda | |
p=${GITHUB_REF##*/} | |
sed -i -e '/^{% set git_tag =/ s+main+'$p'+g' meta.yaml | |
cat meta.yaml | |
sed -i.bak 's|--index-url https://download.pytorch.org/whl/cu118||g' post-link.bat | |
cat post-link.sh | |
echo "::endgroup::" | |
echo "::group::Build" | |
conda update --all --override-channels -c conda-forge -y | |
conda build . --override-channels -c conda-forge | |
echo "::endgroup::" | |
echo $CONDA_PREFIX | |
- name: Test | |
shell: bash -l {0} | |
working-directory: ${{runner.workspace}} | |
run: | | |
echo "::group::Test" | |
echo $CONDA_PREFIX | |
conda search numpy | |
conda create -y -n test --override-channels -c $CONDA_PREFIX/conda-bld/ -c conda-forge trex | |
conda activate test | |
pvinfo -opencv_ffmpeg_support | |
pvinfo -opencv_opencl_support | |
echo "::endgroup::" | |
echo "::group::TestFunctions" | |
cd $GITHUB_WORKSPACE/Application/Tests | |
./run_unix.bash | |
echo "::endgroup::" |