Merge remote-tracking branch 'github/main' into dev

# Conflicts:
#	.github/workflows/BuildTheDocs.yml
#	.github/workflows/CoverageCollection.yml
#	.github/workflows/Parameters.yml
#	.github/workflows/Release.yml
#	.github/workflows/UnitTesting.yml
This commit is contained in:
Patrick Lehmann
2022-11-12 19:33:29 +01:00
5 changed files with 41 additions and 37 deletions

View File

@@ -86,6 +86,7 @@ jobs:
from os import getenv from os import getenv
from pathlib import Path from pathlib import Path
from tomli import load as tomli_load from tomli import load as tomli_load
from textwrap import dedent
htmlDirectory = 'htmlcov' htmlDirectory = 'htmlcov'
xmlFile = './coverage.xml' xmlFile = './coverage.xml'
@@ -118,9 +119,11 @@ jobs:
# Write jobs to special file # Write jobs to special file
github_output = Path(getenv("GITHUB_OUTPUT")) github_output = Path(getenv("GITHUB_OUTPUT"))
print(f"GITHUB_OUTPUT: {github_output}") print(f"GITHUB_OUTPUT: {github_output}")
with github_output.open("a+") as f: with github_output.open("a+", encoding="utf-8") as f:
f.write(f"coverage_report_html_directory={htmlDirectory}\n") f.write(dedent(f"""\
f.write(f"coverage_report_xml={xmlFile}\n") coverage_report_html_directory={htmlDirectory}
coverage_report_xml={xmlFile}
"""))
print(f"DEBUG:\n html={htmlDirectory}\n xml={xmlFile}") print(f"DEBUG:\n html={htmlDirectory}\n xml={xmlFile}")
@@ -155,7 +158,7 @@ jobs:
continue-on-error: true continue-on-error: true
uses: codecov/codecov-action@v3 uses: codecov/codecov-action@v3
with: with:
file: ${{ steps.getVariables.outputs.coverage_report_xml }} files: ${{ steps.getVariables.outputs.coverage_report_xml }}
flags: unittests flags: unittests
env_vars: PYTHON env_vars: PYTHON

View File

@@ -246,11 +246,13 @@ jobs:
# Write jobs to special file # Write jobs to special file
github_output = Path(getenv("GITHUB_OUTPUT")) github_output = Path(getenv("GITHUB_OUTPUT"))
print(f"GITHUB_OUTPUT: {github_output}") print(f"GITHUB_OUTPUT: {github_output}")
with github_output.open("a+") as f: with github_output.open("a+", encoding="utf-8") as f:
f.write(f"python_version={python_version}\n") f.write(dedent(f"""\
f.write(f"python_jobs={json_dumps(jobs)}\n") python_version={python_version}
f.write(f"artifact_names={json_dumps(artifact_names)}\n") python_jobs={json_dumps(jobs)}
f.write(f"params={json_dumps(params)}\n") artifact_names={json_dumps(artifact_names)}
params={json_dumps(params)}
"""))
- name: Verify out parameters - name: Verify out parameters
id: verify id: verify

View File

@@ -94,7 +94,7 @@ jobs:
- name: 📤 Upload 'Static Typing Report' JUnit artifact - name: 📤 Upload 'Static Typing Report' JUnit artifact
if: ${{ inputs.junit_artifact != '' }} if: ${{ inputs.junit_artifact != '' }}
continue-on-error: true continue-on-error: true
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v3
with: with:
name: ${{ inputs.junit_artifact }} name: ${{ inputs.junit_artifact }}
path: ${{ inputs.junit_report }} path: ${{ inputs.junit_report }}

View File

@@ -37,6 +37,6 @@ inputs:
default: POST default: POST
runs: runs:
using: 'node12' using: 'node16'
main: 'main.js' main: 'main.js'
post: 'main.js' post: 'main.js'

View File

@@ -3,7 +3,8 @@
* Unai Martinez-Corral * * Unai Martinez-Corral *
* * * *
* ================================================================================================================== * * ================================================================================================================== *
* Copyright 2021 Unai Martinez-Corral <unai.martinezcorral@ehu.eus> * * Copyright 2021-2022 Unai Martinez-Corral <unai.martinezcorral@ehu.eus> *
* Copyright 2022 Unai Martinez-Corral <umartinezcorral@antmicro.com> *
* * * *
* Licensed under the Apache License, Version 2.0 (the "License"); * * Licensed under the Apache License, Version 2.0 (the "License"); *
* you may not use this file except in compliance with the License. * * you may not use this file except in compliance with the License. *
@@ -25,12 +26,10 @@
* * https://github.com/actions/runner/issues/1478 * * * https://github.com/actions/runner/issues/1478 *
* ================================================================================================================== */ * ================================================================================================================== */
const { spawn } = require("child_process"); const { spawn } = require("child_process");
const fs = require('fs');
function run(cmdline) { function run(cmd) {
var args = cmdline.split(" "); const subprocess = spawn(cmd, { stdio: "inherit", shell: true });
const cmd = args.shift();
const subprocess = spawn(cmd, args, { stdio: "inherit" });
subprocess.on("exit", (exitCode) => { subprocess.on("exit", (exitCode) => {
process.exitCode = exitCode; process.exitCode = exitCode;
}); });
@@ -41,6 +40,6 @@ const key = process.env.INPUT_KEY.toUpperCase();
if ( process.env[`STATE_${key}`] !== undefined ) { // Are we in the 'post' step? if ( process.env[`STATE_${key}`] !== undefined ) { // Are we in the 'post' step?
run(process.env.INPUT_POST); run(process.env.INPUT_POST);
} else { // Otherwise, this is the main step } else { // Otherwise, this is the main step
console.log(`::save-state name=${key}::true`); fs.appendFileSync(process.env.GITHUB_STATE, `${key}=true`);
run(process.env.INPUT_MAIN); run(process.env.INPUT_MAIN);
} }