Github Actions add some configurability. [ci skip]

This commit is contained in:
Pentarctagon 2020-11-20 15:33:32 -06:00
parent 9f2e8a1aef
commit 61192a1423
No known key found for this signature in database
GPG key ID: 9456BC54A21DBFA0
3 changed files with 39 additions and 12 deletions

View file

@ -23,8 +23,8 @@ jobs:
path: ~/build-cache
key: linux-01-master
- name: Ubuntu 20.04 - scons, gcc, LTO, unit tests
run: ./.github/workflows/ci-scripts/ubuntu.sh
- name: Ubuntu 20.04
run: ./.github/workflows/ci-scripts/ubuntu.sh master 2004 false scons gcc g++ 17 release true
linux-02-master:
runs-on: ubuntu-20.04
@ -42,5 +42,5 @@ jobs:
path: ~/build-cache
key: linux-02-master
- name: failure test
run: exit 1
- name: Ubuntu 20.04
run: ./.github/workflows/ci-scripts/ubuntu.sh master 2004 false scons gcc g++ 14 release false

View file

@ -1,9 +1,9 @@
#!/bin/bash
scons wesnoth wesnothd campaignd boost_unit_tests build=release \
ctool=gcc cxxtool=g++ cxx_std=17 \
scons wesnoth wesnothd campaignd boost_unit_tests build="$CFG" \
ctool="$CC" cxxtool="$CXX" cxx_std="$CXX_STD" \
extra_flags_config="-pipe" strict=true forum_user_handler=true \
nls=false enable_lto=true sanitize="" jobs=2 --debug=time
nls="$NLS" enable_lto="$LTO" jobs=2 --debug=time
# set the fake display for unit tests
export DISPLAY=:99.0
@ -33,6 +33,8 @@ checkindent() {
git diff-index --quiet HEAD
}
EXIT_VAL=0
execute "WML validation" ./utils/travis/schema_validation.sh
execute "WML indentation check" checkindent
execute "WML tests" ./run_wml_tests -g -v -c -t 20
@ -43,3 +45,5 @@ if [ -f "errors.log" ]; then
error $'\n*** \n*\n* Errors reported in wml unit tests, here is errors.log...\n*\n*** \n'
cat errors.log
fi
exit $EXIT_VAL

View file

@ -1,13 +1,36 @@
#!/bin/bash
BRANCH="$1"
IMAGE="$2"
NLS="$3"
TOOL="$4"
CC="$5"
CXX="$6"
CXXSTD="$7"
CFG="$8"
LTO="$9"
echo "Using linux:"
echo "BRANCH: $BRANCH"
echo "IMAGE: $IMAGE"
echo "NLS: $NLS"
echo "TOOL: $TOOL"
echo "CC: $CC"
echo "CXX: $CXX"
echo "CXXSTD: $CXXSTD"
echo "CFG: $CFG"
echo "LTO: $LTO"
date
echo FROM wesnoth/wesnoth:2004-master > utils/dockerbuilds/travis/Dockerfile-travis-2004-master
echo COPY ./ /home/wesnoth-travis/ >> utils/dockerbuilds/travis/Dockerfile-travis-2004-master
echo WORKDIR /home/wesnoth-travis >> utils/dockerbuilds/travis/Dockerfile-travis-2004-master
echo FROM wesnoth/wesnoth:"$IMAGE"-"$BRANCH" > utils/dockerbuilds/travis/Dockerfile-travis-"$IMAGE"-"$BRANCH"
echo COPY ./ /home/wesnoth-travis/ >> utils/dockerbuilds/travis/Dockerfile-travis-"$IMAGE"-"$BRANCH"
echo WORKDIR /home/wesnoth-travis >> utils/dockerbuilds/travis/Dockerfile-travis-"$IMAGE"-"$BRANCH"
docker build -t wesnoth-repo:2004-master -f utils/dockerbuilds/travis/Dockerfile-travis-2004-master .
docker build -t wesnoth-repo:"$IMAGE"-"$BRANCH" -f utils/dockerbuilds/travis/Dockerfile-travis-"$IMAGE"-"$BRANCH" .
docker run --cap-add=ALL --privileged \
--volume ~/build-cache:/home/wesnoth-travis/build \
wesnoth-repo:2004-master ./.github/workflows/ci-scripts/docker.sh
--env BRANCH --env IMAGE --env NLS --env TOOL --env CC --env CXX \
--env CFG --env LTO
wesnoth-repo:"$IMAGE"-"$BRANCH" ./.github/workflows/ci-scripts/docker.sh