Skip to content

Commit

Permalink
new round of CI improvements/fixes
Browse files Browse the repository at this point in the history
for Github CI:
- exit->quit in gdb cmdlist
- remove unnecessary backtrace gdb cmd
- remove mymake output buffering for all platforms
- remove `brew update` step
- move from to-be-deprecated emscripten container
- switch to podman instead of docker
- cancel workflow if a more recent one is running

also update Travis config in sync:
- podman has to be installed manually
- try and skip `brew update`
  • Loading branch information
still-flow committed Oct 1, 2020
1 parent 872301c commit 02a348a
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 11 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/github_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ on:
branches: [master]

jobs:
cancel_previous:
name: Cancel workflows for outdated commits
runs-on: ubuntu-latest
steps:
- uses: technote-space/auto-cancel-redundant-job@v1
main_matrix:
name: Unix
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -77,7 +82,7 @@ jobs:
- uses: actions/checkout@v2
- name: Build
run: |
docker run --rm -v $(pwd):/src trzeci/emscripten make -f Makefile.simple emscripten
podman run --rm -v $(pwd):/src emscripten/emsdk make -f Makefile.simple emscripten
- name: Do a simple test
run: |
ls -lAF hyper.html hyper.js hyper.wasm
6 changes: 3 additions & 3 deletions .github/workflows/install_deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ set -x -e o pipefail


GH_DEPS_UBUNTU="$GH_COMPILER libsdl1.2-dev libsdl-ttf2.0-dev libsdl-gfx1.2-dev libsdl-mixer1.2-dev"
GH_DEPS_MACOS="sdl sdl_gfx sdl_mixer sdl_ttf"
GH_DEPS_MACOS="sdl sdl_gfx sdl_mixer sdl_ttf" # macos-latest already has both gcc and clang
GH_DEPS_MINGW64="$GH_COMPILER:x SDL:x SDL_ttf:x SDL_gfx:x SDL_mixer:x make gdb:x"

if [[ "$GH_HYP_GLEW" == "glew_1" ]]; then
Expand All @@ -26,8 +26,8 @@ fi
if [[ "$GH_OS" == "ubuntu-latest" ]]; then
sudo apt-get -y install $GH_DEPS_UBUNTU
elif [[ "$GH_OS" == "macos-latest" ]]; then
brew update
# macos-latest already has both gcc and clang
# As of 2020-09-30, brew update sometimes times out on Github CI, so we don't do it here
# it's also arguably not necessary because VM images already contain recent-ish homebrew database
brew install $GH_DEPS_MACOS
# work around https://stackoverflow.com/questions/51034399/ for now
(cd /usr/local/include && ln -sf SDL/SDL.h)
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/test_simple.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ if [[ "$GH_OS" == "windows-latest" && "$GH_BUILDSYS" == "mymake" ]]; then

cat << ENDOFCMDS > .github/workflows/gdb_cmds.txt
run --version
backtrace
exit 1
quit 1
ENDOFCMDS

gdb --batch -x .github/workflows/gdb_cmds.txt ./hyperrogue
Expand Down
14 changes: 10 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
language: cpp
services:
- docker
matrix:
include:
- os: linux # Linux GCC, autotools
Expand Down Expand Up @@ -135,7 +133,7 @@ before_install:
sudo apt-get update -qq
sudo apt-get install -qq libsdl1.2-dev libsdl-gfx1.2-dev libsdl-mixer1.2-dev libsdl-ttf2.0-dev
elif [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
brew update
# brew update
brew install sdl sdl_gfx sdl_mixer sdl_ttf
# work around https://stackoverflow.com/questions/51034399/ for now
(cd /usr/local/include && ln -sf SDL/SDL.h)
Expand Down Expand Up @@ -175,6 +173,14 @@ before_install:
exit 'Unsupported OS'
fi
fi
- |-
# Install podman if asked for
if [[ "$TRAVIS_BUILD_SYSTEM" == "emscripten" && "$TRAVIS_OS_NAME" == "linux" ]]; then
# partially stolen from https://github.com/junaruga/podman-experiment/blob/master/.travis.yml
sudo add-apt-repository -y ppa:projectatomic/ppa
sudo apt-get update -qq
sudo apt-get install -qq -y podman
fi
script:
- |-
Expand All @@ -193,7 +199,7 @@ script:
./mymake
fi
elif [[ "$TRAVIS_BUILD_SYSTEM" == "emscripten" ]]; then
docker run --rm -v $(pwd):/src trzeci/emscripten make -f Makefile.simple emscripten
podman run --rm -v $(pwd):/src docker.io/emscripten/emsdk make -f Makefile.simple emscripten
else
exit 'Unsupported build system'
fi
Expand Down
2 changes: 1 addition & 1 deletion mymake.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ void set_mingw64() {
linker = "g++ -o hyper";
opts = "-DWINDOWS -DCAP_GLEW=1 -DCAP_PNG=1";
libs = " savepng.o hyper.res -lopengl32 -lSDL -lSDL_gfx -lSDL_mixer -lSDL_ttf -lpthread -lz -lglew32 -lpng";
setvbuf(stdout, NULL, _IONBF, 0); // MinGW is quirky with output buffering
}

vector<string> modules;
Expand All @@ -84,6 +83,7 @@ bool file_exists(string fname) {
}

int main(int argc, char **argv) {
setvbuf(stdout, nullptr, _IONBF, 0); // this should help with responsiveness of the real-time CI logs
#if defined(MAC)
set_mac();
#elif defined(WINDOWS)
Expand Down

0 comments on commit 02a348a

Please sign in to comment.