From 7af3ba168eddd1097cb3a4f2b3e9925e4755ae36 Mon Sep 17 00:00:00 2001 From: igo95862 Date: Mon, 14 Jun 2021 20:44:43 +0300 Subject: [PATCH 1/5] workflows: Separated Ubuntu workflow Added workflow_dispatch trigger for manual runs --- .github/workflows/ubuntu_test.yml | 81 +++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 .github/workflows/ubuntu_test.yml diff --git a/.github/workflows/ubuntu_test.yml b/.github/workflows/ubuntu_test.yml new file mode 100644 index 000000000..0ed2bb760 --- /dev/null +++ b/.github/workflows/ubuntu_test.yml @@ -0,0 +1,81 @@ +--- +name: 🐧 Tests on Ubuntu + +on: + workflow_dispatch: + pull_request: + push: + branches: + - master + +jobs: + tests: + runs-on: ubuntu-latest + env: + COLORTERM: truecolor + TERM: xterm + steps: + - name: Install tools and libraries via APT + run: | + sudo apt install -y \ + build-essential \ + cmake \ + doctest-dev \ + ffmpeg \ + libavcodec-dev \ + libavformat-dev \ + libavutil-dev \ + libncurses-dev \ + libqrcodegen-dev \ + libreadline-dev \ + libswscale-dev \ + libunistring-dev \ + pandoc \ + pkg-config \ + python3-cffi \ + python3-dev \ + python3-setuptools + + - name: Checkout manually + run: | + git clone "https://github.com/${GITHUB_REPOSITORY}" . + + - name: cmake + run: | + mkdir build && cd build + cmake .. \ + -DCMAKE_BUILD_TYPE=Release \ + -DUSE_QRCODEGEN=on + + - name: make + run: | + cd build + make -j"$(nproc)" + + - name: ctest + run: | + cd build + ctest --output-on-failure + + - name: make install + run: | + cd build + sudo make install + sudo ldconfig + + - name: python wrappers + run: | + python3 -m pip install --upgrade pip + pip install pypandoc + cd cffi + python3 setup.py sdist build + sudo python3 setup.py install + notcurses-pydemo > /dev/null + ncdirect-pydemo > /dev/null + + - name: rust wrappers + run: | + cd rust + rustc --version + cargo build + cargo t_all From 7e8b9475088f6c36e3c880afd0e30bb34d2fea72 Mon Sep 17 00:00:00 2001 From: igo95862 Date: Mon, 14 Jun 2021 21:01:39 +0300 Subject: [PATCH 2/5] workflows: Delete old un-split workflow --- .github/workflows/tests.yml | 171 ------------------------------------ 1 file changed, 171 deletions(-) delete mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml deleted file mode 100644 index ebd2739c6..000000000 --- a/.github/workflows/tests.yml +++ /dev/null @@ -1,171 +0,0 @@ -name: Tests - -on: - pull_request: - push: - branches: - - master - -jobs: - tests: - env: - COLORTERM: truecolor - NPROC: 2 - TERM: xterm - strategy: - fail-fast: false - matrix: - platform: - - { - icon: 🍎, - os: macos, - shell: bash --noprofile --norc -eo pipefail - } - - { - icon: 🐧, - os: ubuntu, - shell: bash --noprofile --norc -eo pipefail - } - - { - icon: 🏁, - os: windows, - shell: msys2 - } - name: ${{ matrix.platform.icon }} ${{ matrix.platform.os }} - runs-on: ${{ matrix.platform.os }}-latest - defaults: - run: - shell: ${{ matrix.platform.shell }} {0} - - steps: - - - name: Install tools and libraries via APT - if: matrix.platform.os == 'ubuntu' - run: | - sudo apt install -y \ - build-essential \ - cmake \ - doctest-dev \ - ffmpeg \ - libavcodec-dev \ - libavformat-dev \ - libavutil-dev \ - libncurses-dev \ - libqrcodegen-dev \ - libreadline-dev \ - libswscale-dev \ - libunistring-dev \ - pandoc \ - pkg-config \ - python3-cffi \ - python3-dev \ - python3-setuptools - - - name: Install tools and libraries via Homebrew - if: matrix.platform.os == 'macos' - run: | - brew install \ - coreutils \ - doctest \ - ffmpeg \ - libunistring \ - ncurses \ - pandoc \ - readline - - - name: Install tools and libraries via MSYS2 - if: matrix.platform.os == 'windows' - uses: msys2/setup-msys2@v2 - with: - msystem: MINGW64 - update: true - # installing mingw-w64-x86_64-libxml2 is a workaround for: - # https://github.com/msys2/MINGW-packages/issues/8658 - install: > - base-devel - git - mingw-w64-x86_64-cmake - mingw-w64-x86_64-ffmpeg - mingw-w64-x86_64-libunistring - mingw-w64-x86_64-libxml2 - mingw-w64-x86_64-ncurses - mingw-w64-x86_64-rust - mingw-w64-x86_64-toolchain - - - uses: actions/checkout@v2 - - - name: cmake - run: | - if [[ ${{ matrix.platform.os }} != ubuntu ]]; then - pushd . - mkdir "${HOME}/repos" && cd "${HOME}/repos" - git clone https://github.com/nayuki/QR-Code-generator.git - cd QR-Code-generator/c - if [[ ${{ matrix.platform.os }} = macos ]]; then - AR=/usr/local/opt/llvm/bin/llvm-ar - else - AR="$(which ar)" - fi - make AR="${AR}" - if [[ ${{ matrix.platform.os }} = macos ]]; then - PREFIX=/usr/local - else - PREFIX=/mingw64 - fi - 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 - fi - mkdir build && cd build - if [[ ${{ matrix.platform.os }} = macos ]]; then - cmake .. \ - -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_C_FLAGS="-I/usr/local/include -L/usr/local/lib" \ - -DUSE_QRCODEGEN=on - elif [[ ${{ matrix.platform.os }} = windows ]]; then - cmake .. \ - -G "MSYS Makefiles" \ - -DCMAKE_BUILD_TYPE=Release \ - -DUSE_DOCTEST=off \ - -DUSE_PANDOC=off \ - -DUSE_QRCODEGEN=on - else - cmake .. \ - -DCMAKE_BUILD_TYPE=Release \ - -DUSE_QRCODEGEN=on - fi - - - name: make - run: | - cd build - make -j${NPROC} - - - name: ctest - run: | - cd build - ctest --output-on-failure - - - name: make install - run: | - cd build - sudo make install - sudo ldconfig - - - name: python wrappers - run: | - python3 -m pip install --upgrade pip - pip install pypandoc - cd cffi - python3 setup.py sdist build - sudo python3 setup.py install - notcurses-pydemo > /dev/null - ncdirect-pydemo > /dev/null - - - name: rust wrappers - run: | - cd rust - rustc --version - cargo build - cargo t_all From 4daa1ba77b5463a9c735ce93fc5e010351c48654 Mon Sep 17 00:00:00 2001 From: igo95862 Date: Mon, 14 Jun 2021 21:02:12 +0300 Subject: [PATCH 3/5] workflows: Build new python binds on ubuntu --- .github/workflows/ubuntu_test.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ubuntu_test.yml b/.github/workflows/ubuntu_test.yml index 0ed2bb760..cc93bf71b 100644 --- a/.github/workflows/ubuntu_test.yml +++ b/.github/workflows/ubuntu_test.yml @@ -63,7 +63,7 @@ jobs: sudo make install sudo ldconfig - - name: python wrappers + - name: old python wrappers run: | python3 -m pip install --upgrade pip pip install pypandoc @@ -79,3 +79,10 @@ jobs: 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 From 25963b9bb0d846b13e2e7af02dee12f602d99330 Mon Sep 17 00:00:00 2001 From: igo95862 Date: Mon, 14 Jun 2021 21:17:34 +0300 Subject: [PATCH 4/5] workflows: Added separated MacOS test workflow --- .github/workflows/macos_test.yml | 81 ++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 .github/workflows/macos_test.yml diff --git a/.github/workflows/macos_test.yml b/.github/workflows/macos_test.yml new file mode 100644 index 000000000..4c93737f2 --- /dev/null +++ b/.github/workflows/macos_test.yml @@ -0,0 +1,81 @@ +--- +name: 🍎 MacOS Tests + +on: + workflow_dispatch: + +jobs: + tests: + env: + COLORTERM: truecolor + NPROC: 2 + TERM: xterm + runs-on: macos-latest + + steps: + + - name: Install tools and libraries via Homebrew + run: | + brew install \ + coreutils \ + doctest \ + ffmpeg \ + libunistring \ + ncurses \ + pandoc \ + readline + + - uses: actions/checkout@v2 + + - name: cmake + 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 build && cd build + cmake .. \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_C_FLAGS="-I/usr/local/include -L/usr/local/lib" \ + -DUSE_QRCODEGEN=on + + - name: make + run: | + cd build + make -j${NPROC} + + - name: ctest + run: | + cd build + ctest --output-on-failure + + - name: make install + run: | + cd build + sudo make install + sudo ldconfig + + - name: python wrappers + run: | + python3 -m pip install --upgrade pip + pip install pypandoc + cd cffi + python3 setup.py sdist build + sudo python3 setup.py install + notcurses-pydemo > /dev/null + ncdirect-pydemo > /dev/null + + - name: rust wrappers + run: | + cd rust + rustc --version + cargo build + cargo t_all From 2b3aebe914fd206fe52e3d9055aa881fc1f70bea Mon Sep 17 00:00:00 2001 From: igo95862 Date: Mon, 14 Jun 2021 21:24:01 +0300 Subject: [PATCH 5/5] workflows: Added separated windows workflow --- .github/workflows/windows_test.yml | 89 ++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 .github/workflows/windows_test.yml diff --git a/.github/workflows/windows_test.yml b/.github/workflows/windows_test.yml new file mode 100644 index 000000000..2686d80b3 --- /dev/null +++ b/.github/workflows/windows_test.yml @@ -0,0 +1,89 @@ +--- +name: 🏁 Windows Tests + +on: + workflow_dispatch: + +jobs: + tests: + env: + COLORTERM: truecolor + NPROC: 2 + TERM: xterm + runs-on: windows-latest + steps: + + - name: Install tools and libraries via MSYS2 + uses: msys2/setup-msys2@v2 + with: + msystem: MINGW64 + update: true + # installing mingw-w64-x86_64-libxml2 is a workaround for: + # https://github.com/msys2/MINGW-packages/issues/8658 + install: > + base-devel + git + mingw-w64-x86_64-cmake + mingw-w64-x86_64-ffmpeg + mingw-w64-x86_64-libunistring + mingw-w64-x86_64-libxml2 + mingw-w64-x86_64-ncurses + mingw-w64-x86_64-rust + mingw-w64-x86_64-toolchain + + - uses: actions/checkout@v2 + + - name: cmake + run: | + pushd . + mkdir "${HOME}/repos" && cd "${HOME}/repos" + git clone https://github.com/nayuki/QR-Code-generator.git + cd QR-Code-generator/c + AR="$(which ar)" + make AR="${AR}" + PREFIX=/mingw64 + 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 build && cd build + cmake .. \ + -G "MSYS Makefiles" \ + -DCMAKE_BUILD_TYPE=Release \ + -DUSE_DOCTEST=off \ + -DUSE_PANDOC=off \ + -DUSE_QRCODEGEN=on + + - name: make + run: | + cd build + make -j${NPROC} + + - name: ctest + run: | + cd build + ctest --output-on-failure + + - name: make install + run: | + cd build + sudo make install + sudo ldconfig + + - name: python wrappers + run: | + python3 -m pip install --upgrade pip + pip install pypandoc + cd cffi + python3 setup.py sdist build + sudo python3 setup.py install + notcurses-pydemo > /dev/null + ncdirect-pydemo > /dev/null + + - name: rust wrappers + run: | + cd rust + rustc --version + cargo build + cargo t_all