Skip to content

Commit

Permalink
new round of CI improvements/fixes:
Browse files Browse the repository at this point in the history
- 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
- add a helper log-saver workflow
- switch to podman instead of docker
  • Loading branch information
still-flow committed Sep 29, 2020
1 parent 872301c commit 55ce392
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/github_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,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
32 changes: 32 additions & 0 deletions .github/workflows/github_ci_logs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Github CI log archiver
on:
workflow_run:
workflows: ["Github CI"]
types:
- completed

jobs:
save_logs:
name: Save run logs
runs-on: ubuntu-latest
steps:
- name: Download log archive
run: |
curl -sI -u ${{ github.repository_owner }}:${{ github.token }} \
https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.event.workflow_run.id }}/logs > response.txt
DOWNLOAD_LINK="https:"$(cat response.txt | grep -Fi Location: | cut -d: -f3)
DOWNLOAD_LINK=${DOWNLOAD_LINK%$'\r'}
curl -JO "$DOWNLOAD_LINK"
- name: Unpack log archive
id: archive_unpack
run: |
LOG_FILENAME=$(ls logs* | cut -d. -f1)
echo "::set-output name=log_filename::$LOG_FILENAME"
7z x -ologs "$LOG_FILENAME".zip
- name: Upload log archive as an artifact
uses: actions/upload-artifact@v2
with:
name: ${{ steps.archive_unpack.outputs.log_filename }}
path: logs/**
- name: Print the link to the base run
run: echo "::warning::This log was saved from https://github.com/${{ github.repository }}/actions/runs/${{ github.event.workflow_run.id }}"
1 change: 0 additions & 1 deletion .github/workflows/install_deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ 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
brew install $GH_DEPS_MACOS
# work around https://stackoverflow.com/questions/51034399/ for now
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
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, NULL, _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 55ce392

Please sign in to comment.