diff --git a/.github/workflows/Test.yml b/.github/workflows/Test.yml new file mode 100644 index 0000000..9b07ce2 --- /dev/null +++ b/.github/workflows/Test.yml @@ -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 diff --git a/README.md b/README.md index 2c1395b..77a4b32 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,11 @@ # openFPGALoader -Universal utility for programming FPGA + +

+ 'Test' workflow Status +

+ +Universal utility for programming FPGAs. __Current supported kits:__ diff --git a/scripts/msys2/PKGBUILD b/scripts/msys2/PKGBUILD new file mode 100644 index 0000000..5812176 --- /dev/null +++ b/scripts/msys2/PKGBUILD @@ -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}" +}