Skip to content

Commit

Permalink
Optimizing MSYS2 CI (#1435)
Browse files Browse the repository at this point in the history
* feat(ci): install dependencies on setup
* fix(ci): don't update msys2 when setup
* fix(ci): download subprojects before patching
* doc(ci): document why meson subprojects download is called
  • Loading branch information
takase1121 authored Apr 7, 2023
1 parent 1c01d6c commit 7eaa858
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 9 deletions.
18 changes: 14 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,20 +95,26 @@ jobs:
runs-on: windows-2019
strategy:
matrix:
msystem: [MINGW32, MINGW64]
config:
- {msystem: MINGW32, arch: i686}
- {msystem: MINGW64, arch: x86_64}
defaults:
run:
shell: msys2 {0}
steps:
- uses: actions/checkout@v3
- uses: msys2/setup-msys2@v2
with:
msystem: ${{ matrix.msystem }}
update: true
msystem: ${{ matrix.config.msystem }}
install: >-
base-devel
git
zip
mingw-w64-${{ matrix.config.arch }}-gcc
mingw-w64-${{ matrix.config.arch }}-meson
mingw-w64-${{ matrix.config.arch }}-ninja
mingw-w64-${{ matrix.config.arch }}-ca-certificates
mingw-w64-${{ matrix.config.arch }}-ntldd
- name: Set Environment Variables
run: |
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
Expand All @@ -119,6 +125,7 @@ jobs:
echo "INSTALL_NAME=lite-xl-${GITHUB_REF##*/}-windows-i686" >> "$GITHUB_ENV"
fi
- name: Install Dependencies
if: false
run: bash scripts/install-dependencies.sh --debug
- name: Build
run: |
Expand Down Expand Up @@ -157,8 +164,11 @@ jobs:
"LUA_SUBPROJECT_PATH=subprojects/lua-5.4.4" >> $env:GITHUB_ENV
- name: Configure
run: |
meson setup --wrap-mode=forcefallback build
# Download the subprojects first so we can patch it before configuring.
# This avoids reconfiguring the subprojects when compiling.
meson subprojects download
Get-Content -Path resources/windows/001-lua-unicode.diff -Raw | patch -d $env:LUA_SUBPROJECT_PATH -p1 --forward
meson setup --wrap-mode=forcefallback build
- name: Build
run: |
meson install -C build --destdir="../lite-xl"
Expand Down
15 changes: 10 additions & 5 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,16 @@ main() {

rm -rf "${build_dir}"

if [[ $patch_lua == "true" ]] && [[ ! -z $force_fallback ]]; then
# download the subprojects so we can start patching before configure.
# this will prevent reconfiguring the project.
meson subprojects download
lua_subproject_path=$(echo subprojects/lua-*/)
if [[ -d $lua_subproject_path ]]; then
patch -d $lua_subproject_path -p1 --forward < resources/windows/001-lua-unicode.diff
fi
fi

CFLAGS=$CFLAGS LDFLAGS=$LDFLAGS meson setup \
--buildtype=$build_type \
--prefix "$prefix" \
Expand All @@ -134,11 +144,6 @@ main() {
$pgo \
"${build_dir}"

lua_subproject_path=$(echo subprojects/lua-*/)
if [[ $patch_lua == "true" ]] && [[ ! -z $force_fallback ]] && [[ -d $lua_subproject_path ]]; then
patch -d $lua_subproject_path -p1 --forward < resources/windows/001-lua-unicode.diff
fi

meson compile -C "${build_dir}"

if [[ $pgo != "" ]]; then
Expand Down

0 comments on commit 7eaa858

Please sign in to comment.