From 45ea128f32907be4327631dbc5e773595c34fc33 Mon Sep 17 00:00:00 2001 From: umarcor Date: Sun, 29 Nov 2020 09:26:59 +0100 Subject: [PATCH 01/10] msys: add PKGBUILD --- msys2/PKGBUILD | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 msys2/PKGBUILD diff --git a/msys2/PKGBUILD b/msys2/PKGBUILD new file mode 100644 index 0000000..3c8a5b1 --- /dev/null +++ b/msys2/PKGBUILD @@ -0,0 +1,49 @@ +_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=('AGPLv3.0') +depends=("${MINGW_PACKAGE_PREFIX}-libftdi") +makedepends=("${MINGW_PACKAGE_PREFIX}-gcc" + "${MINGW_PACKAGE_PREFIX}-cmake") + +source=() +sha256sums=() + +build() { + cd "${srcdir}"/../.. + mkdir build + cd build + cmake \ + -G "MinGW Makefiles" \ + -DCMAKE_INSTALL_PREFIX="${pkgdir}${MINGW_PREFIX}" \ + ../ + cmake --build . +} + +check() { + "${srcdir}"/../../build/openFPGALoader.exe --help +} + +package() { + # FIXME: `make install` opens an interactive prompt locally and does nothing in CI + #cd "${srcdir}/${_realname}"/build + #mkdir -p "${pkgdir}${MINGW_PREFIX}" + #make install + + cd "${srcdir}"/../.. + + _bin="${pkgdir}${MINGW_PREFIX}"/bin + _licenses="${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}" + _data="${pkgdir}${MINGW_PREFIX}/share/data/${_realname}" + mkdir -p "${_bin}" "${_licenses}" "${_data}" + + install -m 744 build/openFPGALoader.exe "${_bin}" + install -m 644 LICENSE "${_licenses}" + install -m 644 test_sfl.svf "${_data}" + install -m 644 spiOverJtag/*.bit "${_data}" +} From 685cf5c4104efaa3e4350a4d664dd47c29f66ddf Mon Sep 17 00:00:00 2001 From: umarcor Date: Sun, 29 Nov 2020 09:26:13 +0100 Subject: [PATCH 02/10] ci: add GitHub Actions workflow 'test' --- .github/workflows/test.yml | 49 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..27db6a4 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,49 @@ +name: test + +on: + push: + pull_request: + +jobs: + + test: + runs-on: windows-latest + strategy: + fail-fast: false + matrix: + include: [ + { msystem: MINGW64, arch: x86_64 }, + { msystem: MINGW32, arch: i686 } + ] + defaults: + run: + shell: msys2 {0} + env: + MINGW_INSTALLS: ${{ matrix.msystem }} + steps: + + - run: git config --global core.autocrlf input + shell: bash + + - uses: actions/checkout@v2 + + - uses: msys2/setup-msys2@v2 + with: + msystem: ${{ matrix.msystem }} + install: > + git + base-devel + mingw-w64-${{ matrix.arch }}-toolchain + update: true + + - name: Build + run: | + cd msys2 + makepkg-mingw --noconfirm --noprogressbar -sCLf + + - name: Install + run: pacman -U --noconfirm msys2/*.zst + + - uses: actions/upload-artifact@v2 + with: + path: msys2/*.zst From 28ef4e15512ce8ec22991e5cd39e081aa8b69c70 Mon Sep 17 00:00:00 2001 From: umarcor Date: Sun, 29 Nov 2020 11:21:59 +0100 Subject: [PATCH 03/10] msys2: use mingw32-make --- msys2/PKGBUILD | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/msys2/PKGBUILD b/msys2/PKGBUILD index 3c8a5b1..740760e 100644 --- a/msys2/PKGBUILD +++ b/msys2/PKGBUILD @@ -9,6 +9,7 @@ url="https://github.com/trabucayre/openFPGALoader" license=('AGPLv3.0') depends=("${MINGW_PACKAGE_PREFIX}-libftdi") makedepends=("${MINGW_PACKAGE_PREFIX}-gcc" + "${MINGW_PACKAGE_PREFIX}-make" "${MINGW_PACKAGE_PREFIX}-cmake") source=() @@ -18,9 +19,9 @@ build() { cd "${srcdir}"/../.. mkdir build cd build - cmake \ + MSYS2_ARG_CONV_EXCL=- cmake \ -G "MinGW Makefiles" \ - -DCMAKE_INSTALL_PREFIX="${pkgdir}${MINGW_PREFIX}" \ + -DCMAKE_INSTALL_PREFIX="${MINGW_PREFIX}" \ ../ cmake --build . } @@ -30,20 +31,10 @@ check() { } package() { - # FIXME: `make install` opens an interactive prompt locally and does nothing in CI - #cd "${srcdir}/${_realname}"/build - #mkdir -p "${pkgdir}${MINGW_PREFIX}" - #make install + cd "${srcdir}"/../../build + mingw32-make DESTDIR="${pkgdir}" install - cd "${srcdir}"/../.. - - _bin="${pkgdir}${MINGW_PREFIX}"/bin _licenses="${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}" - _data="${pkgdir}${MINGW_PREFIX}/share/data/${_realname}" - mkdir -p "${_bin}" "${_licenses}" "${_data}" - - install -m 744 build/openFPGALoader.exe "${_bin}" - install -m 644 LICENSE "${_licenses}" - install -m 644 test_sfl.svf "${_data}" - install -m 644 spiOverJtag/*.bit "${_data}" + mkdir -p "${_licenses}" + install -m 644 ../LICENSE "${_licenses}" } From 6f7a452870cad7eb13de1a1de63e5e453346eff8 Mon Sep 17 00:00:00 2001 From: umarcor Date: Sun, 10 Jan 2021 17:56:18 +0100 Subject: [PATCH 04/10] ci/msys2: show package content --- .github/workflows/test.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 27db6a4..259dddc 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -33,6 +33,7 @@ jobs: install: > git base-devel + tree mingw-w64-${{ matrix.arch }}-toolchain update: true @@ -47,3 +48,10 @@ jobs: - uses: actions/upload-artifact@v2 with: path: msys2/*.zst + + - name: Show package content + run: | + mkdir tmp + cd tmp + tar -xf ../msys2/*.zst + tree . From 0cd6b66d6265108b5a27e84a24a81f7a7fe45788 Mon Sep 17 00:00:00 2001 From: umarcor Date: Sun, 10 Jan 2021 18:50:35 +0100 Subject: [PATCH 05/10] msys2: use 'MSYS Makefiles' --- msys2/PKGBUILD | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/msys2/PKGBUILD b/msys2/PKGBUILD index 740760e..f33d09a 100644 --- a/msys2/PKGBUILD +++ b/msys2/PKGBUILD @@ -8,9 +8,10 @@ arch=('any') url="https://github.com/trabucayre/openFPGALoader" license=('AGPLv3.0') depends=("${MINGW_PACKAGE_PREFIX}-libftdi") -makedepends=("${MINGW_PACKAGE_PREFIX}-gcc" - "${MINGW_PACKAGE_PREFIX}-make" - "${MINGW_PACKAGE_PREFIX}-cmake") +makedepends=( + "${MINGW_PACKAGE_PREFIX}-gcc" + "${MINGW_PACKAGE_PREFIX}-cmake" +) source=() sha256sums=() @@ -20,7 +21,7 @@ build() { mkdir build cd build MSYS2_ARG_CONV_EXCL=- cmake \ - -G "MinGW Makefiles" \ + -G "MSYS Makefiles" \ -DCMAKE_INSTALL_PREFIX="${MINGW_PREFIX}" \ ../ cmake --build . @@ -32,7 +33,7 @@ check() { package() { cd "${srcdir}"/../../build - mingw32-make DESTDIR="${pkgdir}" install + make DESTDIR="${pkgdir}" install _licenses="${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}" mkdir -p "${_licenses}" From a493ed0c3bd6b7dfdfd7d1c9238535fcb847e7f8 Mon Sep 17 00:00:00 2001 From: umarcor Date: Sat, 17 Jul 2021 12:00:38 +0200 Subject: [PATCH 06/10] ci: update * Split build and test into two jobs. * Use emojis/icons. * Build/test clang64 and ucrt64 too. * Add workflow_dispatch. --- .github/workflows/Test.yml | 100 +++++++++++++++++++++++++++++++++++++ .github/workflows/test.yml | 57 --------------------- 2 files changed, 100 insertions(+), 57 deletions(-) create mode 100644 .github/workflows/Test.yml delete mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/Test.yml b/.github/workflows/Test.yml new file mode 100644 index 0000000..500d70a --- /dev/null +++ b/.github/workflows/Test.yml @@ -0,0 +1,100 @@ +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 msys2 + makepkg-mingw --noconfirm --noprogressbar -sCLf + + - name: '📤 Upload artifact: package' + uses: actions/upload-artifact@v2 + with: + name: ${{ matrix.sys }}-openFPGALoader + path: msys2/*${{ matrix.env }}*.zst + + - name: '🔍 Show package content' + run: | + mkdir tmp + cd tmp + tar -xf ../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 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index 259dddc..0000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,57 +0,0 @@ -name: test - -on: - push: - pull_request: - -jobs: - - test: - runs-on: windows-latest - strategy: - fail-fast: false - matrix: - include: [ - { msystem: MINGW64, arch: x86_64 }, - { msystem: MINGW32, arch: i686 } - ] - defaults: - run: - shell: msys2 {0} - env: - MINGW_INSTALLS: ${{ matrix.msystem }} - steps: - - - run: git config --global core.autocrlf input - shell: bash - - - uses: actions/checkout@v2 - - - uses: msys2/setup-msys2@v2 - with: - msystem: ${{ matrix.msystem }} - install: > - git - base-devel - tree - mingw-w64-${{ matrix.arch }}-toolchain - update: true - - - name: Build - run: | - cd msys2 - makepkg-mingw --noconfirm --noprogressbar -sCLf - - - name: Install - run: pacman -U --noconfirm msys2/*.zst - - - uses: actions/upload-artifact@v2 - with: - path: msys2/*.zst - - - name: Show package content - run: | - mkdir tmp - cd tmp - tar -xf ../msys2/*.zst - tree . From dddd8a92c845d74c8d639736032715e66d0d7996 Mon Sep 17 00:00:00 2001 From: umarcor Date: Sat, 17 Jul 2021 12:09:31 +0200 Subject: [PATCH 07/10] create subdir 'scripts', mv msys2 there --- .github/workflows/Test.yml | 6 +++--- {msys2 => scripts/msys2}/PKGBUILD | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) rename {msys2 => scripts/msys2}/PKGBUILD (82%) diff --git a/.github/workflows/Test.yml b/.github/workflows/Test.yml index 500d70a..1d5d1e3 100644 --- a/.github/workflows/Test.yml +++ b/.github/workflows/Test.yml @@ -48,20 +48,20 @@ jobs: - name: '🚧 Build package' run: | - cd msys2 + cd scripts/msys2 makepkg-mingw --noconfirm --noprogressbar -sCLf - name: '📤 Upload artifact: package' uses: actions/upload-artifact@v2 with: name: ${{ matrix.sys }}-openFPGALoader - path: msys2/*${{ matrix.env }}*.zst + path: scripts/msys2/*${{ matrix.env }}*.zst - name: '🔍 Show package content' run: | mkdir tmp cd tmp - tar -xf ../msys2/*.zst + tar -xf ../scripts/msys2/*.zst tree . diff --git a/msys2/PKGBUILD b/scripts/msys2/PKGBUILD similarity index 82% rename from msys2/PKGBUILD rename to scripts/msys2/PKGBUILD index f33d09a..e7d187d 100644 --- a/msys2/PKGBUILD +++ b/scripts/msys2/PKGBUILD @@ -17,25 +17,25 @@ source=() sha256sums=() build() { - cd "${srcdir}"/../.. + 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 + "${srcdir}"/build/openFPGALoader.exe --help } package() { - cd "${srcdir}"/../../build + cd "${srcdir}"/build make DESTDIR="${pkgdir}" install _licenses="${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}" mkdir -p "${_licenses}" - install -m 644 ../LICENSE "${_licenses}" + install -m 644 ../../../../LICENSE "${_licenses}" } From b5b50055355d43c850793aeb1cdbcc0ba9edba9a Mon Sep 17 00:00:00 2001 From: umarcor Date: Sat, 17 Jul 2021 12:13:09 +0200 Subject: [PATCH 08/10] readme: add CI shield/badge --- README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 01ad052..4041576 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:__ From 21241cab377d590c6246ba8fa6ae78ad651942b8 Mon Sep 17 00:00:00 2001 From: umarcor Date: Sat, 17 Jul 2021 17:01:51 +0200 Subject: [PATCH 09/10] msys2: fix license, now 'Apache-2.0' --- scripts/msys2/PKGBUILD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/msys2/PKGBUILD b/scripts/msys2/PKGBUILD index e7d187d..5812176 100644 --- a/scripts/msys2/PKGBUILD +++ b/scripts/msys2/PKGBUILD @@ -6,7 +6,7 @@ pkgrel=1 pkgdesc="openFPGALoader: universal utility for programming FPGA (mingw-w64)" arch=('any') url="https://github.com/trabucayre/openFPGALoader" -license=('AGPLv3.0') +license=('Apache-2.0') depends=("${MINGW_PACKAGE_PREFIX}-libftdi") makedepends=( "${MINGW_PACKAGE_PREFIX}-gcc" From ab53a4ac7f04dac7e1502568d4b6c4c043e3014b Mon Sep 17 00:00:00 2001 From: umarcor Date: Sat, 17 Jul 2021 17:03:23 +0200 Subject: [PATCH 10/10] ci: test --detect (allow it to fail) --- .github/workflows/Test.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/Test.yml b/.github/workflows/Test.yml index 1d5d1e3..9b07ce2 100644 --- a/.github/workflows/Test.yml +++ b/.github/workflows/Test.yml @@ -97,4 +97,6 @@ jobs: run: pacman -U --noconfirm --noprogressbar *.zst - name: '🚦 Test package' - run: openFPGALoader --help + run: | + openFPGALoader --help + openFPGALoader --detect || true