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: Windows/MSYS2 packaging #65

Merged
merged 10 commits into from
Jul 17, 2021
Merged
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
102 changes: 102 additions & 0 deletions .github/workflows/Test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
name: Test

on:
push:
pull_request:
workflow_dispatch:

jobs:


win-makepkg:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
include:
- { icon: '⬛', sys: mingw32, env: i686 }
- { icon: '🟦', sys: mingw64, env: x86_64 }
- { icon: '🟨', sys: ucrt64, env: ucrt-x86_64 } # Experimental!
- { icon: '🟧', sys: clang64, env: clang-x86_64 } # Experimental!
name: 🚧${{ matrix.icon }} ${{ matrix.sys }} | ${{ matrix.env }} | makepkg
defaults:
run:
shell: msys2 {0}
env:
MINGW_ARCH: ${{ matrix.sys }}
steps:

- name: '⚙️ git config'
run: git config --global core.autocrlf input
shell: bash

- name: '🧰 Checkout'
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: '${{ matrix.icon }} Setup MSYS2'
uses: msys2/setup-msys2@v2
with:
msystem: ${{ matrix.sys }}
update: true
install: >
git
base-devel
tree
mingw-w64-${{ matrix.env }}-toolchain

- name: '🚧 Build package'
run: |
cd scripts/msys2
makepkg-mingw --noconfirm --noprogressbar -sCLf

- name: '📤 Upload artifact: package'
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.sys }}-openFPGALoader
path: scripts/msys2/*${{ matrix.env }}*.zst

- name: '🔍 Show package content'
run: |
mkdir tmp
cd tmp
tar -xf ../scripts/msys2/*.zst
tree .


win-test:
needs: win-makepkg
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
include:
- { icon: '⬛', sys: mingw32, env: i686 }
- { icon: '🟦', sys: mingw64, env: x86_64 }
- { icon: '🟨', sys: ucrt64, env: ucrt-x86_64 } # Experimental!
- { icon: '🟧', sys: clang64, env: clang-x86_64 } # Experimental!
name: 🚦${{ matrix.icon }} ${{ matrix.sys }} | ${{ matrix.env }} | test
defaults:
run:
shell: msys2 {0}
steps:

- name: '${{ matrix.icon }} Setup MSYS2'
uses: msys2/setup-msys2@v2
with:
msystem: ${{ matrix.sys }}
update: true

- name: '📥 Download artifact: package'
uses: actions/download-artifact@v2
with:
name: ${{ matrix.sys }}-openFPGALoader

- name: '🛠️ Install package'
run: pacman -U --noconfirm --noprogressbar *.zst

- name: '🚦 Test package'
run: |
openFPGALoader --help
openFPGALoader --detect || true
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# openFPGALoader
Universal utility for programming FPGA

<p align="center">
<a title="'Test' workflow Status" href="https://github.com/trabucayre/openFPGALoader/actions?query=workflow%3ATest"><img alt="'Test' workflow Status" src="https://img.shields.io/github/workflow/status/trabucayre/openFPGALoader/Test?longCache=true&style=flat-square&label=Test&logo=github%20actions&logoColor=fff"></a><!--
-->
</p>

Universal utility for programming FPGAs.

__Current supported kits:__

Expand Down
41 changes: 41 additions & 0 deletions scripts/msys2/PKGBUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
_realname=openFPGALoader
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=ci
pkgrel=1
pkgdesc="openFPGALoader: universal utility for programming FPGA (mingw-w64)"
arch=('any')
url="https://github.com/trabucayre/openFPGALoader"
license=('Apache-2.0')
depends=("${MINGW_PACKAGE_PREFIX}-libftdi")
makedepends=(
"${MINGW_PACKAGE_PREFIX}-gcc"
"${MINGW_PACKAGE_PREFIX}-cmake"
)

source=()
sha256sums=()

build() {
cd "${srcdir}"
mkdir build
cd build
MSYS2_ARG_CONV_EXCL=- cmake \
-G "MSYS Makefiles" \
-DCMAKE_INSTALL_PREFIX="${MINGW_PREFIX}" \
../../../..
cmake --build .
}

check() {
"${srcdir}"/build/openFPGALoader.exe --help
}

package() {
cd "${srcdir}"/build
make DESTDIR="${pkgdir}" install

_licenses="${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}"
mkdir -p "${_licenses}"
install -m 644 ../../../../LICENSE "${_licenses}"
}