Skip to content

Commit

Permalink
add VS to CI and comply with licenses better
Browse files Browse the repository at this point in the history
Also includes many small touches to the documentation.
  • Loading branch information
guijan committed Apr 8, 2022
1 parent 5620ee3 commit 63e6cf6
Show file tree
Hide file tree
Showing 16 changed files with 419 additions and 167 deletions.
6 changes: 3 additions & 3 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ task:
kvm: true
name: artix (bleeding edge packages)
setup_script:
- pacman --noconfirm -Syu ninja clang meson
- pacman --noconfirm -Syu ninja clang meson git
<< : *common_script

task:
Expand All @@ -50,7 +50,7 @@ task:
- printf '%s\n' 'objects.githubusercontent.com' >>
/system/etc/static-dns-hosts.txt
- /system/bin/update-static-dns
- pkg install -y ninja clang python
- pkg install -y ninja clang python git
- pip install meson
<< : *common_script

Expand All @@ -69,5 +69,5 @@ task:
kvm: true
name: musl
setup_script:
- apk add meson alpine-sdk clang libbsd-dev
- apk add meson alpine-sdk clang libbsd-dev git
<< : *common_script
81 changes: 67 additions & 14 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ on: [push, pull_request]
# path: build/meson-logs

jobs:
linux:
glibc:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-python@v2.3.1
Expand All @@ -50,7 +50,7 @@ jobs:
- uses: actions/upload-artifact@v2.3.1
if: failure()
with:
name: linux-meson-logs
name: meson-logs-glibc
path: build/meson-logs
macos:
runs-on: macos-latest
Expand All @@ -67,7 +67,7 @@ jobs:
- uses: actions/upload-artifact@v2.3.1
if: failure()
with:
name: macos-meson-logs
name: meson-logs-macos
path: build/meson-logs
msys2:
runs-on: windows-latest
Expand All @@ -81,7 +81,7 @@ jobs:
- uses: msys2/setup-msys2@v2
with:
msystem: ${{matrix.sys}}
install: git groff pactoys
install: git groff pactoys dos2unix
- uses: actions/checkout@v2.4.0
- name: setup-msys
if: ${{matrix.sys == 'msys'}}
Expand All @@ -101,14 +101,10 @@ jobs:
run: meson test -C build
- name: installer
run: ./dictpw_installer.sh -o 'build\setup-dictpw-${{matrix.sys}}.exe'
- name: installer-mui
run: |
./dictpw_installer.sh -mo \
'build\setup-mui-dictpw-${{matrix.sys}}.exe'
- uses: actions/upload-artifact@v2.3.1
if: failure()
with:
name: ${{matrix.sys}}-meson-logs
name: meson-logs-${{matrix.sys}}
path: build/meson-logs
- uses: actions/upload-artifact@v2.3.1
if: success()
Expand All @@ -126,13 +122,14 @@ jobs:
steps:
- run: git config --global core.autocrlf input
# This is NOT the Cygwin bash, it's the Git for Windows bash from the
# default Github Actions Windows VM. This step tells git to translate Unix
# newlines to DOS newlines.
# default Github Actions Windows VM. This step tells git to translate
# Unix newlines to DOS newlines.
shell: bash
- uses: actions/checkout@v2.4.0
- uses: cygwin/cygwin-install-action@master
with:
packages: gcc-core meson groff-perl
# git might be needed while working with git versions of libobsd
packages: gcc-core meson groff-perl git dos2unix
- name: build
run: |
cd ${GITHUB_WORKSPACE}
Expand All @@ -145,7 +142,7 @@ jobs:
- uses: actions/upload-artifact@v2.3.1
if: failure()
with:
name: cygwin-meson-logs
name: meson-logs-cygwin
path: build/meson-logs
haiku:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -175,5 +172,61 @@ jobs:
- uses: actions/upload-artifact@v2.3.1
if: failure()
with:
name: haiku-meson-logs
name: meson-logs-haiku
path: build/meson-logs
vs:
runs-on: windows-latest
strategy:
matrix:
cc: [clang, msvc]
arch: [aarch64, amd64]
steps:
- uses: actions/setup-python@v2.3.1
- run: |
pip install meson
choco install groff dos2unix
- uses: actions/checkout@v2.4.0
- name: build
run: |
if ("${{matrix.arch}}" -eq "aarch64") {
$cross = "--cross-file=.github/workflows/meson-vs-aarch64.txt"
}
if ("${{matrix.cc}}" -eq "msvc") {
# buildtype=plain because b_sanitize doesn't work with debug libs on
# VS.
# Also, asan doesn't seem to be working with clang.
$build = "-Dbuildtype=debug"
$asan = "-Db_sanitize=address"
}
meson setup -Db_vscrt=static_from_buildtype $cross $build $asan `
--backend=vs `
--cross-file=.github/workflows/meson-vs-${{matrix.cc}}.txt build
meson compile -C build
- name: test
run: meson test -C build
- name: get 64-bit NSIS
run: |
# Reference: https://www.msys2.org/docs/ci/
# Run for the first time
C:\msys64\usr\bin\bash -lc ' '
# Update MSYS2
C:\msys64\usr\bin\bash -lc 'pacman --noconfirm -Syuu' # Core update
C:\msys64\usr\bin\bash -lc `
'pacman --noconfirm -Syuu mingw-w64-x86_64-nsis' # Normal update
- name: installer
run: |
$out = "build\setup-dictpw-vs-${{matrix.cc}}-${{matrix.arch}}.exe"
$cmd = "makensis -DOUTFILE='" + "$out" + "' dictpw.nsi"
$env:CHERE_INVOKING = 'yes' # Preserve the current working directory
$env:MSYSTEM = 'MINGW64' # Start a 64 bit Mingw environment
C:\msys64\usr\bin\bash -lc "$cmd"
- uses: actions/upload-artifact@v2.3.1
if: failure()
with:
name: meson-logs-vs-${{matrix.cc}}-${{matrix.arch}}
path: build/meson-logs
- uses: actions/upload-artifact@v2.3.1
if: success()
with:
name: setup-vs-${{matrix.cc}}-${{matrix.arch}}
path: build/setup-*.exe
5 changes: 5 additions & 0 deletions .github/workflows/meson-vs-aarch64.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[host_machine]
system = 'windows'
cpu_family = 'aarch64'
cpu = 'armv8'
endian = 'little'
3 changes: 3 additions & 0 deletions .github/workflows/meson-vs-clang.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[binaries]
c = 'clang-cl'
c_ld = 'lld-link'
3 changes: 3 additions & 0 deletions .github/workflows/meson-vs-msvc.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[binaries]
c = 'cl'
c_ld = 'link'
58 changes: 49 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ on:

jobs:
# keep in sync with msys2 from build-and-test.yml
windows-build:
mingw-build:
runs-on: windows-latest
outputs:
version: ${{steps.installer.outputs.version}}
Expand All @@ -39,26 +39,64 @@ jobs:
pacboy: gcc:p meson:p nsis:p ninja:p jq:p
- uses: actions/checkout@v2.4.0
- name: prepare
run: meson setup -Dbuildtype=release -Dstrip=true build
run: |
meson setup -Dbuildtype=release build
meson compile -C build
strip build/dictpw.exe
- name: installer
id: installer
run: |
ver="$(meson introspect --projectinfo build | jq -r '.version')"
printf '::set-output name=version::%s\n' "$ver"
inst="setup-dictpw-${ver}-${{matrix.sys}}.exe"
inst_mui="setup-mui-dictpw-${ver}-${{matrix.sys}}.exe"
./dictpw_installer.sh -o "build/$inst"
./dictpw_installer.sh -mo "build/$inst_mui"
cd ./build
sha256sum "$inst" > "${inst}.sha256sum"
sha256sum "$inst_mui" > "${inst_mui}.sha256sum"
- uses: actions/upload-artifact@v2.3.1
if: success()
with:
name: dist
path: build/setup*dictpw*
vs-build:
runs-on: windows-latest
steps:
- uses: actions/setup-python@v2.3.1
- name: setup
run: |
pip install meson
choco install groff
- uses: actions/checkout@v2.4.0
- name: prepare
run: |
$cross = "--cross-file=.github/workflows/meson-vs-aarch64.txt"
meson setup -Dbuildtype=release $cross --backend=vs `
--cross-file=.github/workflows/meson-vs-clang.txt build
meson compile -C build
- name: test
run: meson test -C build
- name: get 64-bit NSIS
run: |
# Reference: https://www.msys2.org/docs/ci/
# Run for the first time
C:\msys64\usr\bin\bash -lc ' '
# Update MSYS2
C:\msys64\usr\bin\bash -lc 'pacman --noconfirm -Syuu' # Core update
C:\msys64\usr\bin\bash -lc `
'pacman --noconfirm -Syuu mingw-w64-x86_64-nsis' # Normal update
- name: installer
run: |
$ver = "${{needs.mingw-build.outputs.version}}"
$out = "build\setup-dictpw-${ver}-vs-clang-aarch64.exe"
$cmd = "makensis -DOUTFILE='" + "$out" + "' dictpw.nsi"
$env:CHERE_INVOKING = 'yes' # Preserve the current working directory
$env:MSYSTEM = 'MINGW64' # Start a 64 bit Mingw environment
C:\msys64\usr\bin\bash -lc "$cmd"
- uses: actions/upload-artifact@v2.3.1
if: success()
with:
name: dist
path: build/setup*dictpw*
publish:
needs: windows-build
needs: [mingw-build, vs-build]
runs-on: ubuntu-latest
steps:
- uses: actions/setup-python@v2.3.1
Expand All @@ -74,7 +112,9 @@ jobs:
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
ver="${{needs.windows-build.outputs.version}}"
(cd dist && for file in *.exe; do sha256sum *.exe > \
"${file}.sha256sum"; done)
ver="${{needs.mingw-build.outputs.version}}"
gh release create "v$ver" --title "dictpw $ver" \
--notes-file "docs/CHANGELOG-${ver}.md" \
--target $GITHUB_SHA dist/* build/meson-dist/*
Loading

0 comments on commit 63e6cf6

Please sign in to comment.