Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: add MSYS2 jobs #26

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 56 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,18 @@ jobs:
fail-fast: false
max-parallel: 3
matrix:
os: [ ubuntu, windows, macos ]
runs-on: ${{ matrix.os }}-latest
os: [
{ runs: ubuntu, type: Linux },
{ runs: windows, type: Windows },
{ runs: macos, type: MacOSX }
]
runs-on: ${{ matrix.os.runs }}-latest
defaults:
run:
shell: bash
env:
OS_TYPE: ${{ matrix.os.type }}
DETECTED_OS: ${{ matrix.os.type }}
steps:

- name: Configure git
Expand Down Expand Up @@ -207,3 +214,50 @@ jobs:
run: |
cd test
make test-command


msys2:
strategy:
fail-fast: false
max-parallel: 2
matrix:
msystem: [ MINGW32, MINGW64 ]
runs-on: windows-latest
defaults:
run:
shell: msys2 {0}
steps:

- name: Configure git
shell: bash
run: |
git config --global core.autocrlf input
git config --global core.symlinks true

- uses: actions/checkout@v2
with:
fetch-depth: 0

- uses: msys2/setup-msys2@v2
with:
msystem: ${{ matrix.msystem }}
update: true
install: >
base-devel
git

- name: Make env
run: |
cd test
make env
make env-info

- name: Make example-command
run: |
cd test
make example-command

- name: Make test-command
run: |
cd test
make test-command
13 changes: 8 additions & 5 deletions conda.mk
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ endif

include $(MAKE_DIR)/os.mk

ifeq ($(OS_TYPE),Windows)
ifeq ($(DETECTED_OS),Windows)
TOP_DIR := $(subst /,\,$(TOP_DIR))
OS_EXT := exe
PYTHON_BIN := python.exe
Expand All @@ -43,6 +43,9 @@ SHELL := bash
CONDA_ENV_NAME_LINE := $(shell grep "name:" $(ENVIRONMENT_FILE))
CONDA_ACTIVATE = source $(CONDA_DIR)/bin/activate
endif
ifeq ($(DETECTED_OS),MSYS)
OS_EXT := exe
endif

ifeq (,$(REQUIREMENTS_FILE))
$(error "Set REQUIREMENTS_FILE value before including 'conda.mk'.")
Expand Down Expand Up @@ -105,7 +108,7 @@ $(ENV_DIR): | $(DOWNLOADS_DIR)
$(DOWNLOADS_DIR):
$(MKDIR) "$(DOWNLOADS_DIR)"

ifeq ($(OS_TYPE),Windows)
ifeq ($(DETECTED_OS),Windows)
$(CONDA_INSTALLER_DOWNLOAD): | $(DOWNLOADS_DIR)
$(WGET) https://repo.anaconda.com/miniconda/$(CONDA_INSTALLER) -O $(CONDA_INSTALLER_DOWNLOAD) 2>&1
else
Expand All @@ -118,7 +121,7 @@ $(CONDA_PKGS_DEP): $(CONDA_PYTHON)
$(MKDIR) "$(CONDA_PKGS_DIR)"
$(TOUCH) "$(CONDA_PKGS_DEP)"

ifeq ($(OS_TYPE),Windows)
ifeq ($(DETECTED_OS),Windows)
$(CONDA_PYTHON): $(CONDA_INSTALLER_DOWNLOAD)
cmd.exe /c start "" /WAIT $(CONDA_INSTALLER_DOWNLOAD) /InstallationType=JustMe /AddToPath=0 /RegisterPython=0 /NoRegistry=1 /NoScripts=1 /S /D=$(CONDA_DIR)
$(TOUCH) "$(CONDA_PYTHON)"
Expand All @@ -130,7 +133,7 @@ $(CONDA_PYTHON): $(CONDA_INSTALLER_DOWNLOAD)
endif

# FIXME: Why does this break on Windows?
ifeq ($(OS_TYPE),Windows)
ifeq ($(DETECTED_OS),Windows)
CONDA_PYVENV := $(CONDA_PYTHON)
else
$(CONDA_PYVENV): $(CONDA_PYTHON) $(MAKE_DIR)/conda.mk
Expand Down Expand Up @@ -167,7 +170,7 @@ dist-clean::

FILTER_TOP = sed -e's@$(TOP_DIR)/@$$TOP_DIR/@'
env-info:
@echo " Currently running on: '$(OS_TYPE) ($(CPU_TYPE))'"
@echo " Currently running on: '$(DETECTED_OS) ($(CPU_TYPE))'"
@echo
@echo " Conda environment is named: '$(CONDA_ENV_NAME)'"
@echo " Conda Env Top level directory is: '$(TOP_DIR)'"
Expand Down
8 changes: 6 additions & 2 deletions os.mk
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ ifeq ($(OS_TYPE),)

# MingW windows
ifeq ($(DETECTED_OS),MSYS)
OS_TYPE := Linux
OS_TYPE := Windows
endif

# Mac OS X
Expand Down Expand Up @@ -79,7 +79,7 @@ ifeq ($(CPU_TYPE),)
$(error Unable to detect CPU_TYPE \(detected '$(DETECTED_CPU)'\) - run make with CPU_TYPE=x86)
endif

ifeq ($(OS_TYPE),Windows)
ifeq ($(DETECTED_OS),Windows)
MAKE_DIR := $(subst /,\,$(MAKE_DIR))
SEP := $(strip \ )
CAT := type
Expand All @@ -93,3 +93,7 @@ TOUCH := touch
MKDIR := mkdir -p
WGET := wget
endif

$(info · OS_TYPE: $(OS_TYPE))
$(info · DETECTED_OS: $(DETECTED_OS))
$(info · CPU_TYPE: $(CPU_TYPE))