From 9309beefc4720ea6b9f17b88190f9ef37918b6bb Mon Sep 17 00:00:00 2001 From: Mat Sutcliffe Date: Thu, 18 Jun 2020 22:39:48 +0100 Subject: [PATCH] [CI] Fix stderr not being captured in log --- .github/workflows/build.yml | 31 +++++++++++++++---------------- scripts/build.py | 19 +++++++++---------- 2 files changed, 24 insertions(+), 26 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 86598985a..1c718afc5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -27,7 +27,6 @@ jobs: - name: Get version number id: version run: | - pip3 install tee echo "::set-output name=value::$(python3 -u scripts/build.py --version)" - name: Remove artifacts uses: swift-project/delete-artifact@swift @@ -60,7 +59,7 @@ jobs: sudo apt install cppcheck sudo cpan Path::Class cppcheck --template=gcc --inline-suppr --std=c++14 --enable=style,unusedFunction -i externals \ - --suppressions-list=cppcheck.supp --library=qt.cfg --library=posix.cfg . | tee error.log + --suppressions-list=cppcheck.supp --library=qt.cfg --library=posix.cfg . 2> >(tee error.log >&2) perl scripts/warnings.pl error.log buildLinux: @@ -85,7 +84,6 @@ jobs: - name: Install dependencies run: | sudo apt install doxygen graphviz libglu1-mesa-dev libopus-dev libsodium-dev libpulse-dev libdbus-1-dev libevent-dev - pip3 install tee sudo cpan Path::Class - name: Checkout repository uses: actions/checkout@v2 @@ -105,11 +103,11 @@ jobs: - name: Build swift (without symbols) if: ${{ ! (env.do_symbols == 'true' && env.do_vatsim_key == 'true') }} run: | - python3 -u scripts/build.py -w 64 -t gcc -d -j2 -e $eol_months -q "SWIFT_CONFIG_JSON+=$vatsim_key_file" + python3 -u scripts/build.py -w 64 -t gcc -d -j2 -e $eol_months -q "SWIFT_CONFIG_JSON+=$vatsim_key_file" 2> >(tee error.log >&2) - name: Build swift (with symbols) if: ${{ env.do_symbols == 'true' && env.do_vatsim_key == 'true' }} run: | - python3 -u scripts/build.py -w 64 -t gcc -d -j2 -e $eol_months -q "SWIFT_CONFIG_JSON+=$vatsim_key_file" --upload + python3 -u scripts/build.py -w 64 -t gcc -d -j2 -e $eol_months -q "SWIFT_CONFIG_JSON+=$vatsim_key_file" --upload 2> >(tee error.log >&2) - name: Check warnings id: warnings run: | @@ -153,7 +151,6 @@ jobs: - name: Install dependencies run: | choco install jom --yes - pip install tee - name: Checkout repository uses: actions/checkout@v2 with: @@ -171,16 +168,18 @@ jobs: VATSIM_KEY: ${{ secrets.VATSIM_KEY }} - name: Build swift (without symbols) if: ${{ ! (env.do_symbols == 'true' && env.do_vatsim_key == 'true') }} + shell: bash run: | - python.exe -u scripts\build.py -w 64 -t msvc -d -e $env:eol_months -q "SWIFT_CONFIG_JSON+=$env:vatsim_key_file" + python -u scripts/build.py -w 64 -t msvc -d -e $eol_months -q "SWIFT_CONFIG_JSON+=$vatsim_key_file" 2>&1 | tee error.log - name: Build swift (with symbols) if: ${{ env.do_symbols == 'true' && env.do_vatsim_key == 'true' }} + shell: bash run: | - python.exe -u scripts\build.py -w 64 -t msvc -d -e $env:eol_months -q "SWIFT_CONFIG_JSON+=$env:vatsim_key_file" --upload + python -u scripts/build.py -w 64 -t msvc -d -e $eol_months -q "SWIFT_CONFIG_JSON+=$vatsim_key_file" --upload 2>&1 | tee error.log - name: Check warnings id: warnings run: | - perl scripts/warnings.pl error.log + perl.exe scripts\warnings.pl error.log - name: Upload installer uses: actions/upload-artifact@v2 with: @@ -220,7 +219,6 @@ jobs: - name: Install dependencies run: | choco install jom --yes - pip install tee - name: Checkout repository uses: actions/checkout@v2 with: @@ -238,16 +236,18 @@ jobs: VATSIM_KEY: ${{ secrets.VATSIM_KEY }} - name: Build swift (without symbols) if: ${{ ! (env.do_symbols == 'true' && env.do_vatsim_key == 'true') }} + shell: bash run: | - python.exe -u scripts\build.py -w 32 -t msvc -d -e $env:eol_months -q "SWIFT_CONFIG_JSON+=$env:vatsim_key_file" + python -u scripts/build.py -w 32 -t msvc -d -e $eol_months -q "SWIFT_CONFIG_JSON+=$vatsim_key_file" 2>&1 | tee error.log - name: Build swift (with symbols) if: ${{ env.do_symbols == 'true' && env.do_vatsim_key == 'true' }} + shell: bash run: | - python.exe -u scripts\build.py -w 32 -t msvc -d -e $env:eol_months -q "SWIFT_CONFIG_JSON+=$env:vatsim_key_file" --upload + python -u scripts/build.py -w 32 -t msvc -d -e $eol_months -q "SWIFT_CONFIG_JSON+=$vatsim_key_file" --upload 2>&1 | tee error.log - name: Check warnings id: warnings run: | - perl scripts/warnings.pl error.log + perl.exe scripts\warnings.pl error.log - name: Upload installer uses: actions/upload-artifact@v2 with: @@ -292,7 +292,6 @@ jobs: - name: Install dependencies run: | pip3 install requests - pip3 install tee cpan Path::Class - name: Checkout repository uses: actions/checkout@v2 @@ -312,11 +311,11 @@ jobs: - name: Build swift (without symbols) if: ${{ ! (env.do_symbols == 'true' && env.do_vatsim_key == 'true') }} run: | - python3 -u scripts/build.py -w 64 -t clang -d -j2 -e $eol_months -q "SWIFT_CONFIG_JSON+=$vatsim_key_file" + python3 -u scripts/build.py -w 64 -t clang -d -j2 -e $eol_months -q "SWIFT_CONFIG_JSON+=$vatsim_key_file" 2> >(tee error.log >&2) - name: Build swift (with symbols) if: ${{ env.do_symbols == 'true' && env.do_vatsim_key == 'true' }} run: | - python3 -u scripts/build.py -w 64 -t clang -d -j2 -e $eol_months -q "SWIFT_CONFIG_JSON+=$vatsim_key_file" --upload + python3 -u scripts/build.py -w 64 -t clang -d -j2 -e $eol_months -q "SWIFT_CONFIG_JSON+=$vatsim_key_file" --upload 2> >(tee error.log >&2) - name: Check warnings id: warnings run: | diff --git a/scripts/build.py b/scripts/build.py index 598d145ab..97e41c841 100644 --- a/scripts/build.py +++ b/scripts/build.py @@ -21,7 +21,6 @@ import sys import datastore import tarfile from lib.util import get_vs_env -from tee import StderrTee if sys.version_info < (3, 0): import ConfigParser as configparser @@ -481,15 +480,15 @@ def main(argv): print('Unknown or unsupported tool chain!') sys.exit(2) - with StderrTee('error.log', buff=-1): - builder = builders[platform.system()][tool_chain](config_file, word_size) - builder.prepare() - builder.build(jobs, qmake_args, dev_build, eolInMonth) - builder.checks() - builder.install() - builder.publish() - builder.package_xswiftbus() - builder.symbols(upload_symbols) + builder = builders[platform.system()][tool_chain](config_file, word_size) + + builder.prepare() + builder.build(jobs, qmake_args, dev_build, eolInMonth) + builder.checks() + builder.install() + builder.publish() + builder.package_xswiftbus() + builder.symbols(upload_symbols) # run main if run directly