ci: run GHA workflow for macOS on all commits to master and PRs

Also split out the build of libqrcodegen on macOS into a separate step, and
make the workflows for Ubuntu and macOS as consistent as possible; may require
more changes depending on what passes and doesn't pass on macOS.

The GHA workflow for Windows will be revised in a separate PR.
pull/1937/head
Michael Bradley, Jr 3 years ago
parent 1f254c47b2
commit deccda9f96
No known key found for this signature in database
GPG Key ID: D0307DBCF21A9A58

@ -1,8 +1,11 @@
---
name: 🍎 MacOS Tests
name: macOS
on:
workflow_dispatch:
pull_request:
push:
branches:
- master
jobs:
tests:
@ -10,6 +13,7 @@ jobs:
COLORTERM: truecolor
NPROC: 2
TERM: xterm
name: 🍎 build, test, & install
runs-on: macos-latest
steps:
@ -27,24 +31,27 @@ jobs:
- uses: actions/checkout@v2
- name: cmake
- name: Build libqrcodegen
run: |
pushd .
mkdir "${HOME}/repos" && cd "${HOME}/repos"
git clone https://github.com/nayuki/QR-Code-generator.git
cd QR-Code-generator/c
AR=/usr/local/opt/llvm/bin/llvm-ar
make AR="${AR}"
PREFIX=/usr/local
cd ${PREFIX}/include && \
ln -s "${HOME}/repos/QR-Code-generator/c" qrcodegen
cd ${PREFIX}/lib && \
ln -s "${HOME}/repos/QR-Code-generator/c/libqrcodegen.a" .
popd
mkdir -p "${HOME}"/opt/qrcodegen/{include,lib}
cd "${HOME}/opt/qrcodegen/include" \
&& ln -s "${HOME}/repos/QR-Code-generator/c" ./qrcodegen
cd "${HOME}/opt/qrcodegen/lib" \
&& ln -s "${HOME}/repos/QR-Code-generator/c/libqrcodegen.a" ./libqrcodegen.a
cd /usr/local/opt && ln -s "${HOME}/opt/qrcodegen" ./qrcodegen
- name: cmake
run: |
export PKG_CONFIG_PATH="/usr/local/opt/ncurses/lib/pkgconfig:/usr/local/opt/readline/lib/pkgconfig"
mkdir build && cd build
cmake .. \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_FLAGS="-I/usr/local/include -L/usr/local/lib" \
-DCMAKE_C_FLAGS="-I/usr/local/opt/qrcodegen/include -L/usr/local/opt/qrcodegen/lib" \
-DUSE_QRCODEGEN=on
- name: make
@ -61,20 +68,27 @@ jobs:
run: |
cd build
sudo make install
sudo ldconfig
- name: python wrappers
- name: python wrappers (old)
run: |
python3 -m pip install --upgrade pip
pip install pypandoc
pip install cffi pypandoc
cd cffi
python3 setup.py sdist build
sudo python3 setup.py install
notcurses-pydemo > /dev/null
ncdirect-pydemo > /dev/null
- name: python wrappers (new)
run: |
cd python
python3 setup.py build
sudo python3 setup.py install
python3 examples/000-print-version.py
- name: rust wrappers
run: |
export PKG_CONFIG_PATH="/usr/local/libdata/pkgconfig"
cd rust
rustc --version
cargo build

@ -1,8 +1,7 @@
---
name: 🐧 Tests on Ubuntu
name: Ubuntu
on:
workflow_dispatch:
pull_request:
push:
branches:
@ -10,11 +9,15 @@ on:
jobs:
tests:
runs-on: ubuntu-latest
env:
COLORTERM: truecolor
NPROC: 2
TERM: xterm
name: 🐧 build, test, & install
runs-on: ubuntu-latest
steps:
- name: Install tools and libraries via APT
run: |
sudo apt update
@ -37,9 +40,7 @@ jobs:
python3-dev \
python3-setuptools
- name: Checkout manually
run: |
git clone "https://github.com/${GITHUB_REPOSITORY}" .
- uses: actions/checkout@v2
- name: cmake
run: |
@ -51,7 +52,7 @@ jobs:
- name: make
run: |
cd build
make -j"$(nproc)"
make -j${NPROC}
- name: ctest
run: |
@ -64,7 +65,7 @@ jobs:
sudo make install
sudo ldconfig
- name: old python wrappers
- name: python wrappers (old)
run: |
python3 -m pip install --upgrade pip
pip install pypandoc
@ -74,16 +75,16 @@ jobs:
notcurses-pydemo > /dev/null
ncdirect-pydemo > /dev/null
- name: python wrappers (new)
run: |
cd python
python3 setup.py build
sudo python3 setup.py install
python3 examples/000-print-version.py
- name: rust wrappers
run: |
cd rust
rustc --version
cargo build
cargo t_all
- name: Build new python wrappers
run: |
cd python
python3 setup.py build
sudo python3 setup.py install
python3 examples/000-print-version.py

@ -1,5 +1,5 @@
---
name: 🏁 Windows Tests
name: Windows
on:
workflow_dispatch:
@ -10,6 +10,7 @@ jobs:
COLORTERM: truecolor
NPROC: 2
TERM: xterm
name: 🏁 build, test, & install
runs-on: windows-latest
steps:

@ -50,7 +50,8 @@ sudo apt-get update
[![Sponsor](https://img.shields.io/badge/-Sponsor-red?logo=github)](https://github.com/sponsors/dankamongmen)
[![Build](https://drone.dsscaw.com:4443/api/badges/dankamongmen/notcurses/status.svg)](https://drone.dsscaw.com:4443/dankamongmen/notcurses)
[![🐧 UbuntuTests](https://github.com/dankamongmen/notcurses/actions/workflows/ubuntu_test.yml/badge.svg)](https://github.com/dankamongmen/notcurses/actions/workflows/ubuntu_test.yml)
[![Ubuntu](https://github.com/dankamongmen/notcurses/actions/workflows/ubuntu_test.yml/badge.svg?branch=master)](https://github.com/dankamongmen/notcurses/actions/workflows/ubuntu_test.yml?query=branch%3Amaster)
[![macOS](https://github.com/dankamongmen/notcurses/actions/workflows/macos_test.yml/badge.svg?branch=master)](https://github.com/dankamongmen/notcurses/actions/workflows/macos_test.yml?query=branch%3Amaster)
[![pypi_version](https://img.shields.io/pypi/v/notcurses?label=pypi)](https://pypi.org/project/notcurses)
[![crates.io](https://img.shields.io/crates/v/libnotcurses-sys.svg)](https://crates.io/crates/libnotcurses-sys)

@ -19,13 +19,22 @@ from os import environ
from setuptools import Extension, setup
from sys import platform
if environ.get('CFLAGS') is None:
environ['CFLAGS'] = (
"-Werror "
"-Wextra -Wconversion -Wall")
if platform == "darwin":
environ['CFLAGS'] = (
"-Wextra -Wconversion -Wall")
else:
environ['CFLAGS'] = (
"-Werror "
"-Wextra -Wconversion -Wall")
if environ.get('LDFLAGS') is None:
environ['LDFLAGS'] = "-Wl,--no-as-needed"
if platform == "darwin":
environ['LDFLAGS'] = "-Wl,-all_load"
else:
environ['LDFLAGS'] = "-Wl,--no-as-needed"
setup(
name="notcurses",

Loading…
Cancel
Save