Merge pull request #1937 from michaelsbradleyjr/ci/revise-macos-gha

ci: run GHA workflow for macOS on all commits to master and PRs
pull/1952/head
Michael Bradley 3 years ago committed by GitHub
commit 16cbf91779
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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

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

@ -50,7 +50,8 @@ sudo apt-get update
[![Sponsor](https://img.shields.io/badge/-Sponsor-red?logo=github)](https://github.com/sponsors/dankamongmen) [![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) [![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) [![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) [![crates.io](https://img.shields.io/crates/v/libnotcurses-sys.svg)](https://crates.io/crates/libnotcurses-sys)

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

Loading…
Cancel
Save