Merge pull request #65 from umarcor/ci/msys2

CI: Windows/MSYS2 packaging
This commit is contained in:
Gwenhael Goavec-Merou 2021-07-17 17:26:37 +02:00 committed by GitHub
commit ef52dc3842
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 150 additions and 1 deletions

102
.github/workflows/Test.yml vendored Normal file
View File

@ -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

View File

@ -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:__

41
scripts/msys2/PKGBUILD Normal file
View File

@ -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}"
}