summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Bruhin <me@the-compiler.org>2020-07-03 18:52:47 +0200
committerFlorian Bruhin <me@the-compiler.org>2020-07-03 18:56:54 +0200
commit34f66cf4a8aa8e6311d2c8fea75e8b83e3088a8a (patch)
tree030b8799b4aad0731b487cb4504f616d19026b0f
parentcfc5ac94983d07baa2e1ff97c0382b4e681f536c (diff)
downloadqutebrowser-34f66cf4a8aa8e6311d2c8fea75e8b83e3088a8a.tar.gz
qutebrowser-34f66cf4a8aa8e6311d2c8fea75e8b83e3088a8a.zip
problemmatcher: Take temporary directory as argument
Hopefully fixes things on Docker
-rw-r--r--.github/workflows/ci.yml9
-rw-r--r--scripts/dev/ci/problemmatchers.py10
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:]))