Migrate from travis-ci to github actions.

This commit is contained in:
Anthony Green 2021-07-16 08:29:08 -04:00
parent f9ea416834
commit d1eef90476
18 changed files with 1293 additions and 114 deletions

18
.ci/build-cross-in-container.sh Executable file
View File

@ -0,0 +1,18 @@
#!/bin/bash
set -x
cd /opt
echo $PATH
export PATH=/usr/local/bin:$PATH
echo $PATH
export DEJAGNU=$(pwd)/.ci/site.exp
echo $DEJAGNU
ls -l $DEJAGNU
pwd
find .
./configure --host=${HOST} || cat */config.log
make
make dist
BOARDSDIR=$(pwd)/.ci make check RUNTESTFLAGS="-a $RUNTESTFLAGS" || true

View File

@ -1,12 +1,10 @@
#!/bin/bash
cd /opt
set -x
export QEMU_LD_PREFIX=/usr/${HOST}
export DEJAGNU=/opt/.ci/site.exp
cd /opt
./configure ${HOST+--host=$HOST --disable-shared}
make
make dist
make check RUNTESTFLAGS="-a $RUNTESTFLAGS" || true
BOARDSDIR=/opt/.ci make check RUNTESTFLAGS="-a $RUNTESTFLAGS" || true

View File

@ -35,7 +35,8 @@ function build_linux()
./configure ${HOST+--host=$HOST} ${CONFIGURE_OPTIONS} || cat */config.log
make
make dist
make check RUNTESTFLAGS="-a $RUNTESTFLAGS"
DEJAGNU=$(pwd)/.ci/site.exp BOARDSDIR=$(pwd)/.ci runtest --version
DEJAGNU=$(pwd)/.ci/site.exp BOARDSDIR=$(pwd)/.ci make check RUNTESTFLAGS="-a $RUNTESTFLAGS"
./rlgl l --key=${RLGL_KEY} https://rl.gl
ID=$(./rlgl start)
@ -45,7 +46,7 @@ function build_linux()
function build_foreign_linux()
{
${DOCKER} run --rm -t -i -v $(pwd):/opt ${SET_QEMU_CPU} -e LIBFFI_TEST_OPTIMIZATION="${LIBFFI_TEST_OPTIMIZATION}" $2 bash -c /opt/.travis/build-in-container.sh
${DOCKER} run --rm -t -v $(pwd):/opt ${SET_QEMU_CPU} -e LIBFFI_TEST_OPTIMIZATION="${LIBFFI_TEST_OPTIMIZATION}" $2 bash -c /opt/.ci/build-in-container.sh
./rlgl l --key=${RLGL_KEY} https://rl.gl
ID=$(./rlgl start)
@ -55,7 +56,7 @@ function build_foreign_linux()
function build_cross_linux()
{
${DOCKER} run --rm -t -i -v $(pwd):/opt ${SET_QEMU_CPU} -e HOST="${HOST}" -e CC="${HOST}-gcc-8 ${GCC_OPTIONS}" -e CXX="${HOST}-g++-8 ${GCC_OPTIONS}" -e LIBFFI_TEST_OPTIMIZATION="${LIBFFI_TEST_OPTIMIZATION}" quay.io/moxielogic/cross-ci-build-container:latest bash -c /opt/.travis/build-in-container.sh
${DOCKER} run --rm -t -v $(pwd):/opt ${SET_QEMU_CPU} -e HOST="${HOST}" -e CC="${HOST}-gcc-8 ${GCC_OPTIONS}" -e CXX="${HOST}-g++-8 ${GCC_OPTIONS}" -e LIBFFI_TEST_OPTIMIZATION="${LIBFFI_TEST_OPTIMIZATION}" quay.io/moxielogic/cross-ci-build-container:latest bash -c /opt/.ci/build-in-container.sh
./rlgl l --key=${RLGL_KEY} https://rl.gl
ID=$(./rlgl start)
@ -66,7 +67,7 @@ function build_cross_linux()
function build_cross()
{
${DOCKER} pull quay.io/moxielogic/libffi-ci-${HOST}
${DOCKER} run --rm -t -i -v $(pwd):/opt -e HOST="${HOST}" -e CC="${HOST}-gcc ${GCC_OPTIONS}" -e CXX="${HOST}-g++ ${GCC_OPTIONS}" -e TRAVIS_BUILD_DIR=/opt -e DEJAGNU="${DEJAGNU}" -e RUNTESTFLAGS="${RUNTESTFLAGS}" -e LIBFFI_TEST_OPTIMIZATION="${LIBFFI_TEST_OPTIMIZATION}" quay.io/moxielogic/libffi-ci-${HOST} bash -c /opt/.travis/build-cross-in-container.sh
${DOCKER} run --rm -t -v $(pwd):/opt -e HOST="${HOST}" -e CC="${HOST}-gcc ${GCC_OPTIONS}" -e CXX="${HOST}-g++ ${GCC_OPTIONS}" -e RUNNER_WORKSPACE=/opt -e RUNTESTFLAGS="${RUNTESTFLAGS}" -e LIBFFI_TEST_OPTIMIZATION="${LIBFFI_TEST_OPTIMIZATION}" quay.io/moxielogic/libffi-ci-${HOST} bash -c /opt/.ci/build-cross-in-container.sh
./rlgl l --key=${RLGL_KEY} https://rl.gl
ID=$(./rlgl start)

View File

@ -1,7 +1,7 @@
#!/bin/bash
set -x
if [[ $TRAVIS_OS_NAME != 'linux' ]]; then
if [[ $RUNNER_OS != 'Linux' ]]; then
brew update --verbose
# brew update > brew-update.log 2>&1
# fix an issue with libtool on travis by reinstalling it
@ -48,11 +48,11 @@ else
sudo apt-get install gcc-multilib g++-multilib;
;;
moxie-elf)
echo 'deb https://repos.moxielogic.org:7114/MoxieLogic moxiedev main' | sudo tee -a /etc/apt/sources.list
echo 'deb [trusted=yes] https://repos.moxielogic.org:7114/MoxieLogic moxiedev main' | sudo tee -a /etc/apt/sources.list
sudo apt-get clean # clear the cache
sudo apt-get update ## -qq
sudo apt-get update
sudo apt-get install -y --allow-unauthenticated moxielogic-moxie-elf-gcc moxielogic-moxie-elf-gcc-c++ moxielogic-moxie-elf-gcc-libstdc++ moxielogic-moxie-elf-gdb-sim
sudo apt-get install -y --allow-unauthenticated moxielogic-moxie-elf-gcc moxielogic-moxie-elf-gcc-c++ moxielogic-moxie-elf-gcc-libstdc++ moxielogic-moxie-elf-gdb-sim texinfo sharutils texlive dejagnu
;;
x86_64-w64-mingw32)
sudo apt-get install gcc-mingw-w64-x86-64 g++-mingw-w64-x86-64 wine;

1103
.ci/msvs-detect Executable file

File diff suppressed because it is too large Load Diff

View File

@ -1,11 +1,11 @@
# Copyright (C) 2008, 2010, 2018, 2019 Anthony Green
# Copyright (C) 2008, 2010, 2018, 2019, 2021 Anthony Green
# Make sure we look in the right place for the board description files.
if ![info exists boards_dir] {
set boards_dir {}
}
lappend boards_dir $::env(TRAVIS_BUILD_DIR)/.travis
lappend boards_dir $::env(BOARDSDIR)
verbose "Global Config File: target_triplet is $target_triplet" 2
global target_list
@ -23,5 +23,7 @@ case "$target_triplet" in {
{ "or1k-elf" } {
set target_list "or1k-sim"
}
{ "powerpc-eabisim" } {
set target_list "powerpc-eabisim"
}
}

154
.github/workflows/build.yml vendored Normal file
View File

@ -0,0 +1,154 @@
name: CI
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ github-actions ]
pull_request:
branches: [ github-actions ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
build-sim:
name: Build & test
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- MEVAL: "export CC=clang && CXX=clang"
- HOST: "i386-pc-linux-gnu"
MEVAL: 'export CC="gcc -m32" && CXX="g++ -m32"'
- CONFIGURE_OPTIONS: "--disable-shared"
- CONFIGURE_OPTIONS: "--enable-shared"
- HOST: "m68k-linux-gnu"
MEVAL: 'export CC="m68k-linux-gnu-gcc-8 -mcpu=547x" && CXX="m68k-linux-gnu-g++-8 -mcpu=547x"'
CONFIGURE_OPTIONS: '--disable-shared'
QEMU_LD_PREFIX: '/usr/m68k-linux-gnu'
QEMU_CPU: 'cfv4e'
- HOST: "sh4-linux-gnu"
CONFIGURE_OPTIONS: "--disable-shared"
QEMU_LD_PREFIX: "/usr/sh4-linux-gnu"
QEMU_CPU: 'sh7785'
- HOST: "alpha-linux-gnu"
CONFIGURE_OPTIONS: "--disable-shared"
QEMU_LD_PREFIX: "/usr/alpha-linux-gnu"
- HOST: "arm32v7-linux-gnu"
LIBFFI_TEST_OPTIMIZATION: "-O0"
- HOST: "arm32v7-linux-gnu"
LIBFFI_TEST_OPTIMIZATION: "-O2"
- HOST: "arm32v7-linux-gnu"
LIBFFI_TEST_OPTIMIZATION: "-O2 -fomit-frame-pointer"
- HOST: "powerpc-eabisim"
RUNTESTFLAGS: "--target_board powerpc-eabisim"
- HOST: "or1k-elf"
RUNTESTFLAGS: "--target_board or1k-sim"
- HOST: "m32r-elf"
RUNTESTFLAGS: "--target_board m32-sim"
- HOST: "bfin-elf"
RUNTESTFLAGS: "--target_board bfin-sim"
- MEVAL: "export PATH=/opt/moxielogic/bin:$PATH && CC=moxie-elf-gcc && CXX=moxie-elf-g++"
HOST: "moxie-elf"
LDFLAGS: "-Tsim.ld"
RUNTESTFLAGS: "--target_board moxie-sim"
steps:
- uses: actions/checkout@v2
- env:
MEVAL: ${{ matrix.MEVAL }}
HOST: ${{ matrix.HOST }}
LDFLAGS: ${{ matrix.LDFLAGS }}
RUNTESTFLAGS: ${{ matrix.RUNTESTFLAGS }}
CONFIGURE_OPTIONS: ${{ matrix.CONFIGURE_OPTIONS }}
QEMU_LD_PREFIX: ${{ matrix.QEMU_LD_PREFIX }}
QEMU_CPU: ${{ matrix.QEMU_CPU }}
run: |
if test x"$MEVAL" != x; then eval ${MEVAL}; fi
./.ci/install.sh
./.ci/build.sh
build:
name: Build & test with Cygwin
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
platform: [windows-latest]
steps:
- uses: actions/checkout@v2
- name: Set up Cygwin
uses: egor-tensin/setup-cygwin@v3
with:
platform: x64
packages: wget gcc-core make dejagnu automake autoconf libtool texinfo dos2unix unzip
- run: |
cd $(cygpath $RUNNER_WORKSPACE)/libffi
wget https://rl.gl/cli/rlgl-windows-amd64.zip
unzip rlgl-windows-amd64.zip
find . -name \*.m4|xargs dos2unix
find . -name \*.ac|xargs dos2unix
find . -name \*.am|xargs dos2unix
find . -name \*.host|xargs dos2unix
autoreconf -f -v -i
./configure
find . -name libtool\*|xargs dos2unix
make -j 4
TERM=none export DEJAGNU=$(pwd)/.ci/site.exp BOARDSDIR=$(pwd)/.ci make check || true
./rlgl/rlgl.exe l --key=0LIBFFI-0LIBFFI-0LIBFFI-0LIBFFI https://rl.gl
ID=$(./rlgl/rlgl.exe start)
./rlgl/rlgl.exe e --id=$ID --policy=https://github.com/libffi/rlgl-policy.git $(find . -name libffi.log)
shell: C:\tools\cygwin\bin\bash.exe --login --norc -eo pipefail -o igncr '{0}'
build-msvc:
name: Build & test with Visual C++
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
platform: [windows-latest]
steps:
- uses: actions/checkout@v2
- uses: egor-tensin/setup-cygwin@v3
with:
platform: x64
packages: wget make dejagnu automake autoconf libtool texinfo unzip dos2unix
- uses: ilammy/msvc-dev-cmd@v1.8.1
- uses: microsoft/setup-msbuild@v1.0.2
- name: Build and test
run: |
dos2unix $(cygpath $RUNNER_WORKSPACE)/libffi/.ci/msvs-detect
# $(cygpath $RUNNER_WORKSPACE)/libffi/.ci/msvs-detect --arch=x64 --with-assembler
export PATH=$PATH:"/cygdrive/c/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC/14.16.27023/bin/HostX64/x64"
cd $(cygpath $RUNNER_WORKSPACE)/libffi
wget https://rl.gl/cli/rlgl-windows-amd64.zip
unzip rlgl-windows-amd64.zip
find . -name \*.sh|xargs dos2unix
find . -name \*.m4|xargs dos2unix
find . -name \*.ac|xargs dos2unix
find . -name \*.am|xargs dos2unix
find . -name \*.host|xargs dos2unix
dos2unix .ci/ar-lib
autoreconf -f -v -i
./configure CC="$(pwd)/msvcc.sh -m64" CXX="$(pwd)/msvcc.sh -m64" LD='link' CPP='cl -nologo -EP' CXXCPP='cl -nologo -EP' CPPFLAGS='-DFFI_BUILDING_DLL' AR='$(pwd)/.ci/ar-lib lib' NM='dumpbin -symbols' STRIP=':' --build=$BUILD --host=$HOST $DEBUG_ARG $SHARED_ARG || cat */config.log
find . -name libtool\*|xargs dos2unix
make
cp $(find . -name 'libffi-?.dll') x86_64-pc-cygwin/testsuite/
TERM=none DEJAGNU=$(pwd)/.ci/site.exp BOARDSDIR=$(pwd)/.ci make check || true
./rlgl/rlgl.exe l --key=0LIBFFI-0LIBFFI-0LIBFFI-0LIBFFI https://rl.gl
ID=$(./rlgl/rlgl.exe start)
./rlgl/rlgl.exe e --id=$ID --policy=https://github.com/libffi/rlgl-policy.git $(find . -name libffi.log)
shell: C:\tools\cygwin\bin\bash.exe --login --norc -eo pipefail -o igncr '{0}'

2
.gitignore vendored
View File

@ -9,7 +9,7 @@ Makefile
Makefile.in
aclocal.m4
compile
!.travis/compile
!.ci/compile
configure
depcomp
doc/libffi.info

View File

@ -1,83 +0,0 @@
---
sudo: required
language: cpp
# For qemu-powered targets, get the list of supported processors from
# travis by setting QEMU_CPU=help, then set -mcpu= for the compilers
# accordingly.
matrix:
include:
- os: linux
env: HOST=powerpc-eabisim RUNTESTFLAGS="--target_board powerpc-eabisim" DEJAGNU="/opt/.travis/site.exp"
- os: linux
env: HOST=or1k-elf RUNTESTFLAGS="--target_board or1k-sim" DEJAGNU="/opt/.travis/site.exp"
- os: linux
env: HOST=m32r-elf RUNTESTFLAGS="--target_board m32r-sim" DEJAGNU="/opt/.travis/site.exp"
- os: linux
env: HOST=bfin-elf RUNTESTFLAGS="--target_board bfin-sim" DEJAGNU="/opt/.travis/site.exp"
# This configuration is still using the native x86 toolchain?
# - os: osx
# env: HOST=aarch64-apple-darwin13
- os: osx
env: HOST=x86_64-apple-darwin10
- os: linux
env: HOST=x86_64-w64-mingw32 MEVAL='export CC="x86_64-w64-mingw32-gcc" && CXX="x86_64-w64-mingw32-g++" RUNTESTFLAGS="--target_board wine-sim" DEJAGNU="$TRAVIS_BUILD_DIR/.travis/site.exp" CONFIGURE_OPTIONS=--disable-shared LIBFFI_TEST_OPTIMIZATION="-O2"
- os: linux
env: HOST=sh4-linux-gnu CONFIGURE_OPTIONS=--disable-shared QEMU_LD_PREFIX=/usr/sh4-linux-gnu
- os: linux
env: HOST=alpha-linux-gnu CONFIGURE_OPTIONS=--disable-shared QEMU_LD_PREFIX=/usr/alpha-linux-gnu
- os: linux
env: HOST=m68k-linux-gnu MEVAL='export CC="m68k-linux-gnu-gcc-8 -mcpu=547x" && CXX="m68k-linux-gnu-g++-8 -mcpu=547x"' CONFIGURE_OPTIONS=--disable-shared QEMU_LD_PREFIX=/usr/m68k-linux-gnu QEMU_CPU=cfv4e
- os: linux
arch: s390x
env: HOST=s390x-linux-gnu
- os: linux
arch: ppc64le
env: HOST=ppc64le-linux-gnu
- os: linux
arch: arm64
env: HOST=aarch64-linux-gnu
- os: linux
arch: arm64
env: HOST=aarch64-linux-gnu
compiler: clang
- os: linux
env: HOST=arm32v7-linux-gnu LIBFFI_TEST_OPTIMIZATION="-O0"
- os: linux
env: HOST=arm32v7-linux-gnu LIBFFI_TEST_OPTIMIZATION="-O2"
- os: linux
env: HOST=arm32v7-linux-gnu LIBFFI_TEST_OPTIMIZATION="-O2 -fomit-frame-pointer"
# The sparc64 linux system in the GCC compile farm is non-responsive.
# - os: linux
# env: HOST=sparc64-linux-gnu
# The mips64 linux system in the GCC compile farm is not allowing logins
# - os: linux
# env: HOST=mips64el-linux-gnu
- os: linux
compiler: gcc
env: HOST=i386-pc-linux-gnu MEVAL='export CC="$CC -m32" && CXX="$CXX -m32"'
- os: linux
compiler: gcc
- os: linux
compiler: gcc
env: CONFIGURE_OPTIONS=--disable-shared
- os: linux
compiler: clang
- os: linux
compiler: clang
env: CONFIGURE_OPTIONS=--disable-shared
- os: linux
env: HOST=moxie-elf MEVAL='export PATH=/opt/moxielogic/bin:$PATH && CC=moxie-elf-gcc && CXX=moxie-elf-g++' LDFLAGS=-Tsim.ld RUNTESTFLAGS="--target_board moxie-sim" DEJAGNU="$TRAVIS_BUILD_DIR/.travis/site.exp"
before_install:
- if test x"$MEVAL" != x; then eval ${MEVAL}; fi
install:
- travis_wait 60 ./.travis/install.sh
script:
- if ! test x"$MEVAL" = x; then eval ${MEVAL}; fi
- travis_wait 115 sleep infinity &
- ./.travis/build.sh

View File

@ -1,14 +0,0 @@
#!/bin/bash
cd /opt
echo $PATH
export PATH=/usr/local/bin:$PATH
echo $PATH
./configure --host=${HOST} || cat */config.log
make
make dist
make check RUNTESTFLAGS="-a $RUNTESTFLAGS" || true