From 34f66cf4a8aa8e6311d2c8fea75e8b83e3088a8a Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Fri, 3 Jul 2020 18:52:47 +0200 Subject: problemmatcher: Take temporary directory as argument Hopefully fixes things on Docker --- .github/workflows/ci.yml | 9 ++++++--- scripts/dev/ci/problemmatchers.py | 10 +++------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 47be2944e..cdd53f333 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,7 +36,7 @@ jobs: node-version: '12.x' if: "matrix.testenv == 'eslint'" - name: Set up problem matchers - run: "python3 scripts/dev/ci/problemmatchers.py ${{ matrix.testenv }}" + run: "python3 scripts/dev/ci/problemmatchers.py ${{ matrix.testenv }} ${{ runner.temp }}" - name: Install dependencies run: | [[ ${{ matrix.testenv }} == eslint ]] && npm install -g eslint @@ -62,11 +62,14 @@ jobs: DOCKER: "${{ matrix.image }}" CI: true PYTEST_ADDOPTS: "--color=yes" + volumes: + # Hardcoded because we can't use ${{ runner.temp }} here apparently. + - /home/runner/work/_temp/:/home/runner/work/_temp/ options: --privileged --tty steps: - uses: actions/checkout@v2 - name: Set up problem matchers - run: "python3 scripts/dev/ci/problemmatchers.py py38" + run: "python3 scripts/dev/ci/problemmatchers.py py38 ${{ runner.temp }}" - run: tox -e py38 tests: @@ -142,7 +145,7 @@ jobs: with: python-version: "${{ matrix.python }}" - name: Set up problem matchers - run: "python3 scripts/dev/ci/problemmatchers.py ${{ matrix.testenv }}" + run: "python3 scripts/dev/ci/problemmatchers.py ${{ matrix.testenv }} ${{ runner.temp }}" - name: Install apt dependencies run: sudo apt-get install --no-install-recommends libyaml-dev libegl1-mesa libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 if: "startsWith(matrix.os, 'ubuntu-')" diff --git a/scripts/dev/ci/problemmatchers.py b/scripts/dev/ci/problemmatchers.py index 624791c56..876d00a90 100644 --- a/scripts/dev/ci/problemmatchers.py +++ b/scripts/dev/ci/problemmatchers.py @@ -26,7 +26,6 @@ https://github.com/actions/toolkit/blob/master/docs/commands.md#problem-matchers """ import sys -import tempfile import pathlib import json @@ -182,7 +181,7 @@ def add_matcher(output_dir, testenv, data): print("::add-matcher::{}".format(output_file)) -def main(): +def main(testenv, tempdir): testenv = sys.argv[1] if testenv.startswith('py3'): testenv = 'tests' @@ -190,10 +189,7 @@ def main(): if testenv not in MATCHERS: return - # We're not deleting the temporary file because this is only running on CI - # anyways, and we're not sure if GitHub has already read the file contents - # at the point this script exits. - output_dir = pathlib.Path(tempfile.mkdtemp(suffix='-ghmatchers')) + output_dir = pathlib.Path(tempdir) add_matcher(output_dir=output_dir, testenv=testenv, @@ -201,4 +197,4 @@ def main(): if __name__ == '__main__': - sys.exit(main()) + sys.exit(main(*sys.argv[1:])) -- cgit v1.2.3-54-g00ecf