Skip to content

Commit

Permalink
Refactoring / code cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
shlomif committed Feb 6, 2024
1 parent c6f8e23 commit 403533a
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 47 deletions.
25 changes: 4 additions & 21 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,36 +7,27 @@ environment:
install:
- dir
- cd
# - c:\msys64\usr\bin\bash -l "c:/projects/fc-solve/fc-solve/scripts/ci-appveyor-upgrade-msys2.bash"
# - c:\msys64\usr\bin\bash -lc "pacman -Suuy --noconfirm"
# - c:\msys64\usr\bin\bash -lc "pacman -Suuy --noconfirm ${MSYS_PACKAGES}"
# - c:\msys64\usr\bin\bash -lc "set -e -x; rm -r /etc/pacman.d/gnupg/; pacman-key --init ; pacman-key --populate msys2 ; "
- c:\msys64\usr\bin\bash -lc "pacman --noconfirm -Syuu"
- c:\msys64\usr\bin\bash -lc "pacman --noconfirm -Syuu"
- choco install ag
- choco install strawberryperl || type C:\ProgramData\chocolatey\logs\chocolatey.log
# - exit 1
- set PATH=C:\strawberry\perl\bin;C:\strawberry\perl\site\bin;C:\strawberry\c\bin;%PATH%
# - cd C:\projects\%APPVEYOR_PROJECT_NAME%
- cpanm --notest --quiet Code::TidyAll::Plugin::ClangFormat Code::TidyAll::Plugin::TestCount CHI Devel::Trace Docker::CLI::Wrapper::Container Games::Solitaire::Verify::HorneAutomovePrune LWP Perl::Tidy Task::FreecellSolver::Testing Test::Code::TidyAll
- if not exist C:\libtap mkdir C:\libtap
- copy c:\Python311-x64\python.exe c:\Python311-x64\python3.exe
- SET PATH=C:\Python311-x64;C:\strawberry\c\bin;C:\strawberry\perl\site\bin;C:\strawberry\perl\bin;%PATH%
- python3 -mpip install %PY3MODS%
- perl -v
- copy C:\msys64\mingw64\bin\mingw32-make.exe C:\msys64\mingw64\bin\make.exe
# - SET PATH=C:\strawberry\c\bin;C:\strawberry\perl\site\bin;C:\strawberry\perl\bin;%PATH%
- SET PERL5LIB=C:/_P5/lib/perl5
- SET PERL_LOCAL_LIB_ROOT=C:/_P5
- SET PERL_MB_OPT=--install_base C:/_P5
- SET PERL_MM_OPT=INSTALL_BASE=C:/_P5
- perl -v
# - if not exist C:\libtap\gperf-3.0.4.tar.gz curl -o C:\libtap\gperf-3.0.4.tar.gz http://ftp.gnu.org/pub/gnu/gperf/gperf-3.0.4.tar.gz
- curl -o C:\libtap\gperf-3.0.4.tar.gz http://ftp.gnu.org/pub/gnu/gperf/gperf-3.0.4.tar.gz
- copy C:\libtap\gperf-3.0.4.tar.gz .
- tar -xvf gperf-3.0.4.tar.gz
- if not exist C:\libtap\gperf-3.1.tar.gz curl -o C:\libtap\gperf-3.1.tar.gz http://ftp.gnu.org/pub/gnu/gperf/gperf-3.1.tar.gz
- copy C:\libtap\gperf-3.1.tar.gz .
- tar -xvf gperf-3.1.tar.gz
- set MAKE=C:/strawberry/c/bin/gmake.exe
- cd gperf-3.0.4 && perl ../fc-solve/scripts/ci-build-gperf-mswin.pl && cd ..
- cd gperf-3.1 && perl ../fc-solve/scripts/ci-build-gperf-mswin.pl && cd ..
- git clone https://github.com/clibs/cmocka libtap
- mkdir libtap\b
- cd libtap\b
Expand All @@ -55,7 +46,6 @@ install:
- gmake
- gmake install
- SET MYOLDPATH_=%PATH%
# - SET PATH=C:\MinGW\bin;%PATH%
- mkdir ..\b32
- cd ..\b32
- cmake -G "MinGW Makefiles" -DWITH_TEST_SUITE=OFF -DCMAKE_MAKE_PROGRAM=%CMAKE_MAKE_PROGRAM% -DCMAKE_INSTALL_PREFIX=C:\libtap32 ..
Expand All @@ -76,22 +66,16 @@ test_script:
- dir c:\libtap /s
- set CPATH=C:\libtap\include
- set PATH=C:\libtap\bin;%PATH%
# - set PATH=C:\msys64\mingw64\bin;%PATH%
# - python3 -mpip install %PY3MODS%
- del c:\msys64\mingw64\bin\python*.exe
- set HARNESS_BREAK=1
- set FCS_USE_TEST_RUN=1
- mkdir fc-solve\b
- cd fc-solve\b
# - del c:\strawberry\perl\bin\pkg-config.*
- perl ../scripts/Tatzer -G "MinGW Makefiles" -l x64t --dbm=kaztree
# - perl ../scripts/Tatzer -G "MSYS Makefiles" -l x64t --dbm=kaztree
- SET PATH=C:\projects\fc-solve\fc-solve\scripts\win32;%PATH%
- echo %PATH%
- gmake
- gmake boards
# Trying this hack to take more precendence for Inline::C / etc.
# - SET PATH=C:\strawberry\c\bin;C:\strawberry\perl\site\bin;C:\strawberry\perl\bin;C:\_P5\bin;%PATH%
- perl ../source/run-tests.pl
- echo %PATH%
- cd ..
Expand All @@ -105,7 +89,6 @@ test_script:
- mkdir pkg-build
- cd pkg-build
# For generating 32-bit release binaries.
# - SET PATH=C:\MinGW\bin;%PATH%
- perl ../scripts/Tatzer -G "MinGW Makefiles" --notest-suite -r --dbm=none
- gmake package
# See https://stackoverflow.com/questions/29754510/generating-an-installer-using-cmake-cpack-wix
Expand Down
16 changes: 7 additions & 9 deletions .github/workflows/windows-x64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,6 @@ jobs:
c:\msys64\usr\bin\bash -lc "pacman --noconfirm -Syuu" || ( echo Failed
& exit /B 1 )
c:\msys64\usr\bin\bash -lc "pacman --noconfirm -Syuu" || ( echo Failed
& exit /B 1 )
choco install ag || ( echo Failed & exit /B 1 )
if not exist C:\libtap mkdir C:\libtap || ( echo Failed & exit /B
Expand All @@ -79,17 +76,18 @@ jobs:
perl -v || ( echo Failed & exit /B 1 )
curl -o C:\libtap\gperf-3.0.4.tar.gz http://ftp.gnu.org/pub/gnu/gperf/gperf-3.0.4.tar.gz
|| ( echo Failed & exit /B 1 )
if not exist C:\libtap\gperf-3.1.tar.gz curl -o C:\libtap\gperf-3.1.tar.gz
http://ftp.gnu.org/pub/gnu/gperf/gperf-3.1.tar.gz || ( echo Failed
& exit /B 1 )
copy C:\libtap\gperf-3.0.4.tar.gz . || ( echo Failed & exit /B 1 )
copy C:\libtap\gperf-3.1.tar.gz . || ( echo Failed & exit /B 1 )
tar -xvf gperf-3.0.4.tar.gz || ( echo Failed & exit /B 1 )
tar -xvf gperf-3.1.tar.gz || ( echo Failed & exit /B 1 )
set MAKE=C:/strawberry/c/bin/gmake.exe
cd gperf-3.0.4 && perl ../fc-solve/scripts/ci-build-gperf-mswin.pl
&& cd .. || ( echo Failed & exit /B 1 )
cd gperf-3.1 && perl ../fc-solve/scripts/ci-build-gperf-mswin.pl &&
cd .. || ( echo Failed & exit /B 1 )
git clone https://github.com/clibs/cmocka libtap || ( echo Failed
& exit /B 1 )
Expand Down
16 changes: 7 additions & 9 deletions .github/workflows/windows-x86.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,6 @@ jobs:
c:\msys64\usr\bin\bash -lc "pacman --noconfirm -Syuu" || ( echo Failed
& exit /B 1 )
c:\msys64\usr\bin\bash -lc "pacman --noconfirm -Syuu" || ( echo Failed
& exit /B 1 )
choco install ag || ( echo Failed & exit /B 1 )
if not exist C:\libtap mkdir C:\libtap || ( echo Failed & exit /B
Expand All @@ -79,17 +76,18 @@ jobs:
perl -v || ( echo Failed & exit /B 1 )
curl -o C:\libtap\gperf-3.0.4.tar.gz http://ftp.gnu.org/pub/gnu/gperf/gperf-3.0.4.tar.gz
|| ( echo Failed & exit /B 1 )
if not exist C:\libtap\gperf-3.1.tar.gz curl -o C:\libtap\gperf-3.1.tar.gz
http://ftp.gnu.org/pub/gnu/gperf/gperf-3.1.tar.gz || ( echo Failed
& exit /B 1 )
copy C:\libtap\gperf-3.0.4.tar.gz . || ( echo Failed & exit /B 1 )
copy C:\libtap\gperf-3.1.tar.gz . || ( echo Failed & exit /B 1 )
tar -xvf gperf-3.0.4.tar.gz || ( echo Failed & exit /B 1 )
tar -xvf gperf-3.1.tar.gz || ( echo Failed & exit /B 1 )
set MAKE=C:/strawberry/c/bin/gmake.exe
cd gperf-3.0.4 && perl ../fc-solve/scripts/ci-build-gperf-mswin.pl
&& cd .. || ( echo Failed & exit /B 1 )
cd gperf-3.1 && perl ../fc-solve/scripts/ci-build-gperf-mswin.pl &&
cd .. || ( echo Failed & exit /B 1 )
git clone https://github.com/clibs/cmocka libtap || ( echo Failed
& exit /B 1 )
Expand Down
11 changes: 3 additions & 8 deletions fc-solve/CI-testing/translate-travis.yml-to-github-actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,11 @@


def _add_condition_while_excluding_gh_actions(job_dict, is_act):
"""
See:
"""See:
https://github.com/actions/runner/issues/480
Workflow level `env` does not work properly in all fields. · Issue #480
"""
if is_act:
job_dict['if'] = \
Expand Down Expand Up @@ -70,9 +68,7 @@ def _process_env(env, env_keys):
steps.append({"run": ("sudo apt-get update -qq"), })

def _libgd_workaround(steps):
'''
See: https://github.com/actions/runner-images/issues/6153
'''
# See: https://github.com/actions/runner-images/issues/6153
steps.append({
"run": ("sudo apt-get -y remove "
"libgd3 libunwind-14 libunwind-dev nginx"), })
Expand Down Expand Up @@ -174,8 +170,7 @@ def _calc_batch_code(cmds):
end = "^7z a"
start_idx = [
i for i, cmd in enumerate(cmds)
if cmd == "cd .." and
cmds[i+1] == start
if (cmd == "cd .." and cmds[i+1] == start)
][0]
end_idx = start_idx + 1
while not re.search(end, cmds[end_idx]):
Expand Down

0 comments on commit 403533a

Please sign in to comment.