mirror of
https://github.com/pyTooling/Actions.git
synced 2026-02-12 02:56:56 +08:00
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:
49
.github/workflows/CoverageCollection.yml
vendored
49
.github/workflows/CoverageCollection.yml
vendored
@@ -83,9 +83,10 @@ jobs:
|
||||
id: getVariables
|
||||
shell: python
|
||||
run: |
|
||||
from os import getenv
|
||||
from pathlib import Path
|
||||
from tomli import load as tomli_load
|
||||
from os import getenv
|
||||
from pathlib import Path
|
||||
from tomli import load as tomli_load
|
||||
from textwrap import dedent
|
||||
|
||||
htmlDirectory = 'htmlcov'
|
||||
xmlFile = './coverage.xml'
|
||||
@@ -93,34 +94,36 @@ jobs:
|
||||
|
||||
# Read output paths from 'pyproject.toml' file
|
||||
if coverageRC == "pyproject.toml":
|
||||
pyProjectFile = Path("pyproject.toml")
|
||||
if pyProjectFile.exists():
|
||||
with pyProjectFile.open("rb") as file:
|
||||
pyProjectSettings = tomli_load(file)
|
||||
pyProjectFile = Path("pyproject.toml")
|
||||
if pyProjectFile.exists():
|
||||
with pyProjectFile.open("rb") as file:
|
||||
pyProjectSettings = tomli_load(file)
|
||||
|
||||
htmlDirectory = pyProjectSettings["tool"]["coverage"]["html"]["directory"]
|
||||
xmlFile = pyProjectSettings["tool"]["coverage"]["xml"]["output"]
|
||||
else:
|
||||
print(f"File '{pyProjectFile}' not found and no ' .coveragerc' file specified.")
|
||||
htmlDirectory = pyProjectSettings["tool"]["coverage"]["html"]["directory"]
|
||||
xmlFile = pyProjectSettings["tool"]["coverage"]["xml"]["output"]
|
||||
else:
|
||||
print(f"File '{pyProjectFile}' not found and no ' .coveragerc' file specified.")
|
||||
|
||||
# Read output paths from '.coveragerc' file
|
||||
elif len(coverageRC) > 0:
|
||||
coverageRCFile = Path(coverageRC)
|
||||
if coverageRCFile.exists():
|
||||
with coverageRCFile.open("rb") as file:
|
||||
coverageRCSettings = tomli_load(file)
|
||||
coverageRCFile = Path(coverageRC)
|
||||
if coverageRCFile.exists():
|
||||
with coverageRCFile.open("rb") as file:
|
||||
coverageRCSettings = tomli_load(file)
|
||||
|
||||
htmlDirectory = coverageRCSettings["html"]["directory"]
|
||||
xmlFile = coverageRCSettings["xml"]["output"]
|
||||
else:
|
||||
print(f"File '{coverageRCFile}' not found.")
|
||||
htmlDirectory = coverageRCSettings["html"]["directory"]
|
||||
xmlFile = coverageRCSettings["xml"]["output"]
|
||||
else:
|
||||
print(f"File '{coverageRCFile}' not found.")
|
||||
|
||||
# Write jobs to special file
|
||||
github_output = Path(getenv("GITHUB_OUTPUT"))
|
||||
print(f"GITHUB_OUTPUT: {github_output}")
|
||||
with github_output.open("a+") as f:
|
||||
f.write(f"coverage_report_html_directory={htmlDirectory}\n")
|
||||
f.write(f"coverage_report_xml={xmlFile}\n")
|
||||
with github_output.open("a+", encoding="utf-8") as f:
|
||||
f.write(dedent(f"""\
|
||||
coverage_report_html_directory={htmlDirectory}
|
||||
coverage_report_xml={xmlFile}
|
||||
"""))
|
||||
|
||||
print(f"DEBUG:\n html={htmlDirectory}\n xml={xmlFile}")
|
||||
|
||||
@@ -155,7 +158,7 @@ jobs:
|
||||
continue-on-error: true
|
||||
uses: codecov/codecov-action@v3
|
||||
with:
|
||||
file: ${{ steps.getVariables.outputs.coverage_report_xml }}
|
||||
files: ${{ steps.getVariables.outputs.coverage_report_xml }}
|
||||
flags: unittests
|
||||
env_vars: PYTHON
|
||||
|
||||
|
||||
12
.github/workflows/Parameters.yml
vendored
12
.github/workflows/Parameters.yml
vendored
@@ -246,11 +246,13 @@ jobs:
|
||||
# Write jobs to special file
|
||||
github_output = Path(getenv("GITHUB_OUTPUT"))
|
||||
print(f"GITHUB_OUTPUT: {github_output}")
|
||||
with github_output.open("a+") as f:
|
||||
f.write(f"python_version={python_version}\n")
|
||||
f.write(f"python_jobs={json_dumps(jobs)}\n")
|
||||
f.write(f"artifact_names={json_dumps(artifact_names)}\n")
|
||||
f.write(f"params={json_dumps(params)}\n")
|
||||
with github_output.open("a+", encoding="utf-8") as f:
|
||||
f.write(dedent(f"""\
|
||||
python_version={python_version}
|
||||
python_jobs={json_dumps(jobs)}
|
||||
artifact_names={json_dumps(artifact_names)}
|
||||
params={json_dumps(params)}
|
||||
"""))
|
||||
|
||||
- name: Verify out parameters
|
||||
id: verify
|
||||
|
||||
2
.github/workflows/StaticTypeCheck.yml
vendored
2
.github/workflows/StaticTypeCheck.yml
vendored
@@ -94,7 +94,7 @@ jobs:
|
||||
- name: 📤 Upload 'Static Typing Report' JUnit artifact
|
||||
if: ${{ inputs.junit_artifact != '' }}
|
||||
continue-on-error: true
|
||||
uses: actions/upload-artifact@v2
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: ${{ inputs.junit_artifact }}
|
||||
path: ${{ inputs.junit_report }}
|
||||
|
||||
@@ -37,6 +37,6 @@ inputs:
|
||||
default: POST
|
||||
|
||||
runs:
|
||||
using: 'node12'
|
||||
using: 'node16'
|
||||
main: 'main.js'
|
||||
post: 'main.js'
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
* 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"); *
|
||||
* you may not use this file except in compliance with the License. *
|
||||
@@ -25,12 +26,10 @@
|
||||
* * https://github.com/actions/runner/issues/1478 *
|
||||
* ================================================================================================================== */
|
||||
const { spawn } = require("child_process");
|
||||
const fs = require('fs');
|
||||
|
||||
function run(cmdline) {
|
||||
var args = cmdline.split(" ");
|
||||
const cmd = args.shift();
|
||||
|
||||
const subprocess = spawn(cmd, args, { stdio: "inherit" });
|
||||
function run(cmd) {
|
||||
const subprocess = spawn(cmd, { stdio: "inherit", shell: true });
|
||||
subprocess.on("exit", (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?
|
||||
run(process.env.INPUT_POST);
|
||||
} 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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user