]> granicus.if.org Git - fortune-mod/commitdiff
gh actions #1: add
authorShlomi Fish <shlomif@shlomifish.org>
Sat, 11 Dec 2021 14:36:29 +0000 (16:36 +0200)
committerShlomi Fish <shlomif@shlomifish.org>
Sat, 11 Dec 2021 14:36:29 +0000 (16:36 +0200)
.act-github/workflows/use-github-actions.yml [new file with mode: 0644]
.appveyor.yml
.github/workflows/use-github-actions.yml [new file with mode: 0644]
.github/workflows/windows-x64.yml [new file with mode: 0644]
.github/workflows/windows-x86.yml [new file with mode: 0644]
.travis.yml
CI-testing/gh-actions--windows-yml--from-p5-UV.yml [new file with mode: 0644]
CI-testing/translate-travis.yml-to-github-actions.py [new file with mode: 0644]

diff --git a/.act-github/workflows/use-github-actions.yml b/.act-github/workflows/use-github-actions.yml
new file mode 100644 (file)
index 0000000..2efa0ed
--- /dev/null
@@ -0,0 +1,35 @@
+jobs:
+    test-fc-solve:
+        runs-on: ubuntu-latest
+        steps:
+        -   uses: actions/checkout@v2
+            with:
+                submodules: 'true'
+        -   run: sudo apt-get update -qq
+        -   run: sudo apt-get --no-install-recommends install -y eatmydata
+        -   run: sudo eatmydata apt-get --no-install-recommends install -y asciidoc
+                cmake cpanminus dbtoepub docbook-xsl docbook-xsl-ns gcc libperl-dev
+                librecode-dev make perl valgrind xsltproc xz-utils zip
+        -   run: local_lib_shim() { eval "$(perl -Mlocal::lib=$HOME/perl_modules)";
+                } ; local_lib_shim ; cpanm local::lib
+        -   run: local_lib_shim() { eval "$(perl -Mlocal::lib=$HOME/perl_modules)";
+                } ; local_lib_shim ; eval "$(perl -Mlocal::lib=$HOME/perl_modules)"
+        -   run: local_lib_shim() { eval "$(perl -Mlocal::lib=$HOME/perl_modules)";
+                } ; local_lib_shim ; cpanm App::Docmake Code::TidyAll::Plugin::ClangFormat
+                Code::TidyAll::Plugin::Flake8 Code::TidyAll::Plugin::TestCount File::Find::Object
+                List::Util Path::Tiny Perl::Critic Perl::Tidy Test::Code::TidyAll
+                Test::Differences Test::RunValgrind Test::Trap
+        -   run: local_lib_shim() { eval "$(perl -Mlocal::lib=$HOME/perl_modules)";
+                } ; local_lib_shim ; true
+        -   run: local_lib_shim() { eval "$(perl -Mlocal::lib=$HOME/perl_modules)";
+                } ; local_lib_shim ; perl -ln -i -E 'print unless /^\[ClangFormat\]$/../^$/'
+                fortune-mod/.tidyallrc
+        -   run: local_lib_shim() { eval "$(perl -Mlocal::lib=$HOME/perl_modules)";
+                } ; local_lib_shim ; export FORTUNE_TEST_TIDY=1
+        -   run: local_lib_shim() { eval "$(perl -Mlocal::lib=$HOME/perl_modules)";
+                } ; local_lib_shim ; perl CI-testing/continuous-integration-testing.pl
+        -   run: local_lib_shim() { eval "$(perl -Mlocal::lib=$HOME/perl_modules)";
+                } ; local_lib_shim ; rm -fr B
+name: use-github-actions
+'on':
+- push
index 9565318a0f55559775cc79843442935e681b7c5c..9477bcc2429997c6883bbe1ec8f0decbd4a7a8c2 100644 (file)
@@ -5,7 +5,7 @@ clone_folder: c:\projects\fortune-mod
 environment:
     global:
         MSYSTEM: MINGW64
-        VERBOSE: 1
+        VERBOSE: "1"
 image: Visual Studio 2019
 install:
     # Trying to disable to check if it is already installed.
diff --git a/.github/workflows/use-github-actions.yml b/.github/workflows/use-github-actions.yml
new file mode 100644 (file)
index 0000000..2efa0ed
--- /dev/null
@@ -0,0 +1,35 @@
+jobs:
+    test-fc-solve:
+        runs-on: ubuntu-latest
+        steps:
+        -   uses: actions/checkout@v2
+            with:
+                submodules: 'true'
+        -   run: sudo apt-get update -qq
+        -   run: sudo apt-get --no-install-recommends install -y eatmydata
+        -   run: sudo eatmydata apt-get --no-install-recommends install -y asciidoc
+                cmake cpanminus dbtoepub docbook-xsl docbook-xsl-ns gcc libperl-dev
+                librecode-dev make perl valgrind xsltproc xz-utils zip
+        -   run: local_lib_shim() { eval "$(perl -Mlocal::lib=$HOME/perl_modules)";
+                } ; local_lib_shim ; cpanm local::lib
+        -   run: local_lib_shim() { eval "$(perl -Mlocal::lib=$HOME/perl_modules)";
+                } ; local_lib_shim ; eval "$(perl -Mlocal::lib=$HOME/perl_modules)"
+        -   run: local_lib_shim() { eval "$(perl -Mlocal::lib=$HOME/perl_modules)";
+                } ; local_lib_shim ; cpanm App::Docmake Code::TidyAll::Plugin::ClangFormat
+                Code::TidyAll::Plugin::Flake8 Code::TidyAll::Plugin::TestCount File::Find::Object
+                List::Util Path::Tiny Perl::Critic Perl::Tidy Test::Code::TidyAll
+                Test::Differences Test::RunValgrind Test::Trap
+        -   run: local_lib_shim() { eval "$(perl -Mlocal::lib=$HOME/perl_modules)";
+                } ; local_lib_shim ; true
+        -   run: local_lib_shim() { eval "$(perl -Mlocal::lib=$HOME/perl_modules)";
+                } ; local_lib_shim ; perl -ln -i -E 'print unless /^\[ClangFormat\]$/../^$/'
+                fortune-mod/.tidyallrc
+        -   run: local_lib_shim() { eval "$(perl -Mlocal::lib=$HOME/perl_modules)";
+                } ; local_lib_shim ; export FORTUNE_TEST_TIDY=1
+        -   run: local_lib_shim() { eval "$(perl -Mlocal::lib=$HOME/perl_modules)";
+                } ; local_lib_shim ; perl CI-testing/continuous-integration-testing.pl
+        -   run: local_lib_shim() { eval "$(perl -Mlocal::lib=$HOME/perl_modules)";
+                } ; local_lib_shim ; rm -fr B
+name: use-github-actions
+'on':
+- push
diff --git a/.github/workflows/windows-x64.yml b/.github/workflows/windows-x64.yml
new file mode 100644 (file)
index 0000000..30e1a89
--- /dev/null
@@ -0,0 +1,125 @@
+# This file is GENERATED BY
+# CI-testing/translate-travis.yml-to-github-actions.py
+jobs:
+    perl:
+        runs-on: windows-latest
+        steps:
+        -   name: Setup perl
+            uses: shogo82148/actions-setup-perl@v1
+            with:
+                distribution: strawberry
+                perl-version: ${{ matrix.perl-version }}
+        -   name: Set git to use LF
+            run: 'git config --global core.autocrlf false
+
+                git config --global core.eol lf
+
+                '
+        -   uses: actions/checkout@v2
+            with:
+                submodules: 'true'
+        -   name: perl -V
+            run: perl -V
+        -   name: install cpanm and mult modules
+            uses: perl-actions/install-with-cpanm@v1
+            with:
+                install: 'App::Docmake
+
+                    Code::TidyAll::Plugin::ClangFormat
+
+                    Code::TidyAll::Plugin::Flake8
+
+                    Code::TidyAll::Plugin::TestCount
+
+                    Env::Path
+
+                    File::Find::Object
+
+                    IO::All
+
+                    List::Util
+
+                    Path::Tiny
+
+                    Perl::Critic
+
+                    Perl::Tidy
+
+                    Pod::Coverage::TrustPod
+
+                    String::ShellQuote
+
+                    Test::Code::TidyAll
+
+                    Test::Differences
+
+                    Test::EOL
+
+                    Test::Pod
+
+                    Test::Pod::Coverage
+
+                    Test::RunValgrind
+
+                    Test::TrailingSpace
+
+                    Test::Trap'
+        -   name: install and test_script code
+            run: '@echo on
+
+                SET MSYSTEM=MINGW64
+
+                SET VERBOSE=1
+
+                IF NOT EXIST C:\strawberry ( echo "strawberryperl is not installed.
+                Please fix appveyor.yml" exit 1 ) || ( echo Failed & exit /B 1 )
+
+                SET PATH=C:\strawberry\c\bin;C:\strawberry\perl\site\bin;C:\strawberry\perl\bin;%PATH%
+
+                perl -v || ( echo Failed & exit /B 1 )
+
+                IF NOT EXIST C:\Perl5 mkdir C:\Perl5 || ( echo Failed & exit /B 1
+                )
+
+                SET PATH=C:\msys64\bin;C:\Perl5\bin;C:\strawberry\c\bin;C:\strawberry\perl\site\bin;C:\strawberry\perl\bin;%PATH%
+
+                SET PERL5LIB=C:/Perl5/lib/perl5
+
+                SET PERL_LOCAL_LIB_ROOT=C:/Perl5
+
+                SET PERL_MB_OPT=--install_base C:/Perl5
+
+                SET PERL_MM_OPT=INSTALL_BASE=C:/Perl5
+
+                C:\cygwin64\setup-x86_64.exe -qgnNdO -l C:\cygwin64\var\cache\setup
+                -R c:\cygwin64 -s http://cygwin.mirror.constant.com -P docbook-xml
+                -P docbook-xsl -P libxml2 -P libxslt || ( echo Failed & exit /B 1
+                )
+
+                set CMAKE_MAKE_PROGRAM=C:\strawberry\c\bin\gmake.exe
+
+                set CPATH=c:\mingw64\include;c:\msys64\mingw64\include
+
+                set LIBRARY_PATH=c:\mingw64\lib;c:\msys64\mingw64\lib
+
+                set PATH=%PATH%;c:\mingw64\lib;c:\mingw64\bin;c:\msys64\mingw64\lib;c:\msys64\mingw64\bin
+
+                SET PATH=%PATH%;C:\Python35-x64
+
+                SET FORTUNE_TEST_DEBUG=1
+
+                SET DOCMAKE_PATH_PREFIX="C:\cygwin64\bin;"
+
+                perl CI-testing/continuous-integration-testing.pl --gen="MSYS Makefiles"
+                || ( echo Failed & exit /B 1 )
+
+                '
+            shell: cmd
+        strategy:
+            fail-fast: true
+            matrix:
+                perl-version:
+                - '5.30'
+name: windows-x64
+'on':
+- push
diff --git a/.github/workflows/windows-x86.yml b/.github/workflows/windows-x86.yml
new file mode 100644 (file)
index 0000000..b06936e
--- /dev/null
@@ -0,0 +1,133 @@
+# This file is GENERATED BY
+# CI-testing/translate-travis.yml-to-github-actions.py
+jobs:
+    perl:
+        runs-on: windows-latest
+        steps:
+        -   name: Setup perl
+            uses: shogo82148/actions-setup-perl@v1
+            with:
+                distribution: strawberry
+                perl-version: ${{ matrix.perl-version }}
+        -   name: Set git to use LF
+            run: 'git config --global core.autocrlf false
+
+                git config --global core.eol lf
+
+                '
+        -   uses: actions/checkout@v2
+            with:
+                submodules: 'true'
+        -   name: perl -V
+            run: perl -V
+        -   name: install cpanm and mult modules
+            uses: perl-actions/install-with-cpanm@v1
+            with:
+                install: 'App::Docmake
+
+                    Code::TidyAll::Plugin::ClangFormat
+
+                    Code::TidyAll::Plugin::Flake8
+
+                    Code::TidyAll::Plugin::TestCount
+
+                    Env::Path
+
+                    File::Find::Object
+
+                    IO::All
+
+                    List::Util
+
+                    Path::Tiny
+
+                    Perl::Critic
+
+                    Perl::Tidy
+
+                    Pod::Coverage::TrustPod
+
+                    String::ShellQuote
+
+                    Test::Code::TidyAll
+
+                    Test::Differences
+
+                    Test::EOL
+
+                    Test::Pod
+
+                    Test::Pod::Coverage
+
+                    Test::RunValgrind
+
+                    Test::TrailingSpace
+
+                    Test::Trap'
+        -   name: Set up MinGW
+            uses: egor-tensin/setup-mingw@v2
+            with:
+                platform: x86
+        -   name: install and test_script code
+            run: '@echo on
+
+                SET MSYSTEM=MINGW64
+
+                SET VERBOSE=1
+
+                SET CC=cc
+
+                SET CXX=c++
+
+                IF NOT EXIST C:\strawberry ( echo "strawberryperl is not installed.
+                Please fix appveyor.yml" exit 1 ) || ( echo Failed & exit /B 1 )
+
+                SET PATH=C:\strawberry\c\bin;C:\strawberry\perl\site\bin;C:\strawberry\perl\bin;%PATH%
+
+                perl -v || ( echo Failed & exit /B 1 )
+
+                IF NOT EXIST C:\Perl5 mkdir C:\Perl5 || ( echo Failed & exit /B 1
+                )
+
+                SET PATH=C:\msys64\bin;C:\Perl5\bin;C:\strawberry\c\bin;C:\strawberry\perl\site\bin;C:\strawberry\perl\bin;%PATH%
+
+                SET PERL5LIB=C:/Perl5/lib/perl5
+
+                SET PERL_LOCAL_LIB_ROOT=C:/Perl5
+
+                SET PERL_MB_OPT=--install_base C:/Perl5
+
+                SET PERL_MM_OPT=INSTALL_BASE=C:/Perl5
+
+                C:\cygwin64\setup-x86_64.exe -qgnNdO -l C:\cygwin64\var\cache\setup
+                -R c:\cygwin64 -s http://cygwin.mirror.constant.com -P docbook-xml
+                -P docbook-xsl -P libxml2 -P libxslt || ( echo Failed & exit /B 1
+                )
+
+                set CMAKE_MAKE_PROGRAM=C:\strawberry\c\bin\gmake.exe
+
+                set CPATH=c:\mingw64\include;c:\msys64\mingw64\include
+
+                set LIBRARY_PATH=c:\mingw64\lib;c:\msys64\mingw64\lib
+
+                set PATH=%PATH%;c:\mingw64\lib;c:\mingw64\bin;c:\msys64\mingw64\lib;c:\msys64\mingw64\bin
+
+                SET PATH=%PATH%;C:\Python35-x64
+
+                SET FORTUNE_TEST_DEBUG=1
+
+                SET DOCMAKE_PATH_PREFIX="C:\cygwin64\bin;"
+
+                perl CI-testing/continuous-integration-testing.pl --gen="MSYS Makefiles"
+                || ( echo Failed & exit /B 1 )
+
+                '
+            shell: cmd
+        strategy:
+            fail-fast: true
+            matrix:
+                perl-version:
+                - '5.30'
+name: windows-x86
+'on':
+- push
index 472cf254c8a7255d791ec238362208f67f0e4c96..be83313f21dab291a7827134234f3a6bd83b430f 100644 (file)
@@ -27,7 +27,7 @@ cache:
 dist: focal
 install:
     # Required to avoid default travis "cpanm ." booboo.
-    - true
+    - "true"
 language: perl
 os: linux
 perl:
diff --git a/CI-testing/gh-actions--windows-yml--from-p5-UV.yml b/CI-testing/gh-actions--windows-yml--from-p5-UV.yml
new file mode 100644 (file)
index 0000000..5149539
--- /dev/null
@@ -0,0 +1,51 @@
+name: windows
+'on':
+  push:
+    branches:
+      - '*'
+    tags-ignore:
+      - '*'
+  pull_request:
+jobs:
+  perl:
+    runs-on: windows-latest
+    strategy:
+      fail-fast: true
+      matrix:
+        perl-version:
+          - '5.30'
+          # - '5.28'
+          # - '5.26'
+          # - '5.24'
+          # - '5.22'
+          # - '5.20'
+          # - '5.18'
+          # - '5.16'
+          # - '5.14'
+    steps:
+      - name: Setup perl
+        uses: shogo82148/actions-setup-perl@v1
+        with:
+          perl-version: ${{ matrix.perl-version }}
+          distribution: strawberry
+      - name: Set git to use LF
+        run: |
+          git config --global core.autocrlf false
+          git config --global core.eol lf
+      - uses: actions/checkout@v2
+        with:
+          submodules: "true"
+      - name: perl -V
+        run: perl -V
+      - name: Install Alien::libuv
+        run: |
+          cpanm ExtUtils::Manifest App::cpanminus
+          cpanm --notest Alien::Base::Wrapper
+          cpanm --notest --installdeps Alien::libuv
+          cpanm --notest Alien::libuv
+      - name: Install Module::Build::Using::PkgConfig
+        run: cpanm --notest Module::Build::Using::PkgConfig
+      - name: Install Dependencies
+        run: cpanm --notest --installdeps -v .
+      - name: Run Tests
+        run: cpanm --testonly -v .
diff --git a/CI-testing/translate-travis.yml-to-github-actions.py b/CI-testing/translate-travis.yml-to-github-actions.py
new file mode 100644 (file)
index 0000000..e5ecf0b
--- /dev/null
@@ -0,0 +1,265 @@
+#! /usr/bin/env python3
+# -*- coding: utf-8 -*-
+# vim:fenc=utf-8
+#
+# Copyright © 2021 Shlomi Fish < https://www.shlomifish.org/ >
+#
+# Licensed under the terms of the MIT license.
+
+"""
+CI-testing/translate-travis.yml-to-github-actions.py :
+
+This program translates fc-solve's .travis.yml to GitHub actions
+and ACT workflows ( https://github.com/nektos/act ).
+
+While ostensibly FOSS, it most probably is not generic enough
+for your use cases.
+
+"""
+
+import re
+
+import yaml
+
+
+def _add_condition_while_excluding_gh_actions(job_dict, is_act):
+    """
+    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'] = \
+            "${{ ! contains(env.ACT_SKIP, matrix.env.WHAT) }}"
+
+
+def generate(output_path, is_act):
+    """docstring for main"""
+    env_keys = set()
+
+    def _process_env(env):
+        ret = {}
+        for line in env:
+            m = re.match(
+                '\\A([A-Za-z0-9_]+)=([A-Za-z0-9_]+)\\Z',
+                line)
+            key = m.group(1)
+            val = m.group(2)
+            assert key not in ret
+            ret[key] = val
+            env_keys.add(key)
+        return ret
+    with open("./.travis.yml", "rt") as infh:
+        data = yaml.safe_load(infh)
+    steps = []
+    steps.append({
+        "uses": ("actions/checkout@v2"),
+        "with": {
+            "submodules": "true",
+        },
+    })
+    if 0:
+        steps.append({
+            "run":
+            ("cd workflow ; (ls -lrtA ; false)"), })
+    elif 0:
+        steps.append({
+            "run":
+            ("cd . ; (ls -lrtA ; false)"), })
+    steps.append({"run": ("sudo apt-get update -qq"), })
+    steps.append({
+        "run": ("sudo apt-get --no-install-recommends install -y " +
+                " ".join(["eatmydata"])
+                ),
+        }
+    )
+    steps.append({
+        "run": ("sudo eatmydata apt-get --no-install-recommends install -y " +
+                " ".join(data['addons']['apt']['packages'])
+                ),
+        }
+    )
+    local_lib_shim = 'local_lib_shim() { eval "$(perl ' + \
+        '-Mlocal::lib=$HOME/' + \
+        'perl_modules)"; } ; local_lib_shim ; '
+    for arr in ['before_install', 'install', 'script']:
+        steps += [{"run": local_lib_shim + x} for x in data[arr]]
+    job = 'test-fc-solve'
+    o = {'jobs': {job: {'runs-on': 'ubuntu-latest',
+         'steps': steps, }},
+         'name': 'use-github-actions', 'on': ['push', ], }
+    if 'matrix' in data:
+        if 'include' in data['matrix']:
+            o['jobs'][job]['strategy'] = {'matrix': {'include': [
+                {'env': _process_env(x['env']), }
+                for x in data['matrix']['include']
+            ], }, }
+            o['jobs'][job]['env'] = {
+                x: "${{ matrix.env." + x + " }}"
+                for x in env_keys
+            }
+            _add_condition_while_excluding_gh_actions(
+                job_dict=o['jobs'][job],
+                is_act=is_act,
+            )
+        else:
+            assert False
+    with open(output_path, "wt") as outfh:
+        # yaml.safe_dump(o, outfh)
+        yaml.safe_dump(o, stream=outfh, canonical=False, indent=4, )
+
+
+def generate_windows_yaml(plat, output_path, is_act):
+    """docstring for main"""
+    env_keys = set()
+
+    def _process_env(env):
+        ret = {}
+        for line in env:
+            m = re.match(
+                '\\A([A-Za-z0-9_]+)=([A-Za-z0-9_]+)\\Z',
+                line)
+            key = m.group(1)
+            val = m.group(2)
+            assert key not in ret
+            ret[key] = val
+            env_keys.add(key)
+        return ret
+    with open("./.appveyor.yml", "rt") as infh:
+        data = yaml.safe_load(infh)
+    with open("./CI-testing/gh-actions--" +
+              "windows-yml--from-p5-UV.yml", "rt") as infh:
+        skel = yaml.safe_load(infh)
+    steps = skel['jobs']['perl']['steps']
+    while steps[-1]['name'] != 'perl -V':
+        steps.pop()
+
+    cpanm_step = {
+        "name": "install cpanm and mult modules",
+        "uses": "perl-actions/install-with-cpanm@v1",
+    }
+    steps.append(cpanm_step)
+    # if True:  # plat == 'x86':
+    if plat == 'x86':
+        mingw = {
+            "name": "Set up MinGW",
+            "uses": "egor-tensin/setup-mingw@v2",
+            "with": {
+                "platform": plat,
+            },
+        }
+        steps.append(mingw)
+
+    # See:
+    #
+    # https://github.com/sithlord48/blackchocobo/actions/runs/1207252836/workflow#L100
+    # https://github.community/t/windows-actions-suddenly-fail-needing-a-nuspec-file/199483
+    cpack_fix = {
+        "if": "runner.os == 'Windows'",
+        "name": "Remove Chocolatey's CPack",
+        "run": "Remove-Item -Path " +
+        "C:\\ProgramData\\Chocolatey\\bin\\cpack.exe -Force",
+    }
+    cpack_fix_needed = False
+    if cpack_fix_needed:
+        steps.append(cpack_fix)
+
+    def _calc_batch_code(cmds):
+        cmds = [(x['cmd'] if isinstance(x, dict) else x) for x in cmds]
+        batch = ""
+        batch += "@echo on\n"
+        for k, v in sorted(data['environment']['global'].items()):
+            # batch += "SET " + k + "=\"" + v + "\"\n"
+            batch += "SET " + k + "=" + v + "\n"
+        if plat == 'x86':
+            idx = 0
+            cmds.insert(idx, "SET CXX=c++")
+            cmds.insert(idx, "SET CC=cc")
+
+        for cmd in cmds:
+            if cmd.startswith("cpanm "):
+                words = cmd.split(' ')[1:]
+                dw = []
+                for w in words:
+                    if not w.startswith("-"):
+                        dw.append(w)
+                nonlocal cpanm_step
+                cpanm_step['with'] = {"install": "\n".join(dw), }
+                continue
+            if re.search("copy.*?python\\.exe", cmd):
+                continue
+            if "choco install strawberryperl" not in cmd:
+                if 0:
+                    r = re.sub(
+                        "curl\\s+-o\\s+(\\S+)\\s+(\\S+)",
+                        "lwp-download \\2 \\1",
+                        cmd)
+                elif plat == 'x86':
+                    if cmd.startswith("perl ../source/run-tests.pl"):
+                        continue
+                    r = re.sub(
+                        "--dbm=kaztree",
+                        "--dbm=none",
+                        cmd
+                    )
+                else:
+                    r = cmd
+                # See:
+                # https://serverfault.com/questions/157173
+                shim = ''
+                if not (r.lower().startswith("set ")):
+                    shim = " || ( echo Failed & exit /B 1 )"
+                batch += r + shim + "\n"
+        return batch
+
+    if 0:
+        steps.append({'name': "install code", "run": _calc_batch_code(
+            cmds=data['install']), "shell": "cmd", })
+    steps.append({
+        'name': "install and test_script code",
+        "run": _calc_batch_code(
+            cmds=(data['install']+data['test_script'])
+        ),
+        "shell": "cmd",
+    })
+
+    def _myfilt(path):
+        is32 = ("\\pkg-build\\" in path)
+        return (is32 if plat == 'x86' else (not is32))
+    skel['name'] = ("windows-x86" if plat == 'x86' else 'windows-x64')
+    skel['on'] = ['push']
+    with open(output_path, "wt") as outfh:
+        # yaml.safe_dump(o, outfh)
+        outfh.write(
+            "# This file is GENERATED BY\n" +
+            "# CI-testing/" +
+            "translate-travis.yml-to-github-actions.py\n")
+        yaml.safe_dump(skel, stream=outfh, canonical=False, indent=4, )
+
+
+def main():
+    generate(
+        output_path=".github/workflows/use-github-actions.yml",
+        is_act=False,
+    )
+    generate(
+        output_path=".act-github/workflows/use-github-actions.yml",
+        is_act=True,
+    )
+    generate_windows_yaml(
+        plat='x86',
+        output_path=".github/workflows/windows-x86.yml",
+        is_act=False,
+    )
+    generate_windows_yaml(
+        plat='x64',
+        output_path=".github/workflows/windows-x64.yml",
+        is_act=False,
+    )
+
+
+if __name__ == "__main__":
+    main()