problemmatcher: Take temporary directory as argument
Hopefully fixes things on Docker
This commit is contained in:
parent
cfc5ac9498
commit
34f66cf4a8
|
|
@ -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-')"
|
||||
|
|
|
|||
|
|
@ -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:]))
|
||||
|
|
|
|||
Loading…
Reference in New Issue