-
Notifications
You must be signed in to change notification settings - Fork 377
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Try #829: --target mips64-unknown-linux-muslabi64
- Loading branch information
Showing
8 changed files
with
183 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
name: llvm coverage | ||
description: Sets up everything that is needed for coverage. Makes artifacts available for processing later, prefixed with _coverage- | ||
inputs: | ||
name: | ||
description: 'the name of the artifact' | ||
required: true | ||
outputs: | ||
artifact-name: | ||
description: 'the name of the artifact' | ||
value: ${{ steps.cov.outputs.artifact-name }} | ||
runs: | ||
using: composite | ||
steps: | ||
- name: Install cargo-llvm-cov | ||
uses: taiki-e/install-action@v1 | ||
with: | ||
tool: cargo-llvm-cov | ||
- run: rustup component add llvm-tools-preview | ||
shell: bash | ||
- name: LLVM instrument coverage | ||
id: cov | ||
uses: ./.github/actions/post | ||
if: always() | ||
with: | ||
main: | | ||
pwd=$(pwd) | ||
if which cygpath; then | ||
pwd="$(cygpath -w "$(pwd)")" | ||
fi | ||
echo RUSTFLAGS=" -C instrument-coverage --remap-path-prefix ${pwd}=" >> $GITHUB_ENV | ||
echo LLVM_PROFILE_FILE="${pwd}/target/cross-%m.profraw" >> $GITHUB_ENV | ||
echo CARGO_INCREMENTAL="0" >> $GITHUB_ENV | ||
echo RUST_TEST_THREADS="1" >> $GITHUB_ENV | ||
echo "::set-output name=artifact-name::_coverage-${name}" | ||
post: | | ||
# XXX(emilgardis): Upload early? | ||
pwd=$(pwd) | ||
if which cygpath; then | ||
pwd="$(cygpath -w "$(pwd)")" | ||
fi | ||
# No pwd needed here, we're in the root | ||
export LLVM_PROFILE_FILE="${pwd}/target/cross-%m.profraw" | ||
export CARGO_LLVM_COV_TARGET_DIR="${pwd}/target" | ||
mkdir coverage | ||
echo $(ls target) | ||
cargo llvm-cov --no-run --remap-path-prefix --lcov --output-path "coverage/lcov.${name}.info" -vv || ( echo "::error title=Coverage merge failed::" && exit 0 ) | ||
rm target/*.profraw | ||
npm install @actions/artifact | ||
npm install glob | ||
cat <<-EOT | node - || ( echo "::error title=Coverage upload failed::" && exit 0 ) | ||
(async function main() { | ||
var artifact = require('@actions/artifact'); | ||
var glob = require('glob') | ||
const artifactClient = artifact.create(); | ||
const artifactName = '_coverage-' + process.env.name; | ||
const files = glob.sync("coverage/*"); | ||
if (!files.length) { | ||
process.exit(0); | ||
} | ||
console.log("${files}") | ||
const options = { retentionDays: 2 }; | ||
const upload = await artifactClient.uploadArtifact(artifactName, files, "coverage", options); | ||
})() | ||
EOT | ||
env: | ||
name: ${{ inputs.name }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# adapted from https://github.com/actions/runner/issues/1478 | ||
name: With post step | ||
description: 'Generic JS Action to execute a main command and set a command in a post step.' | ||
inputs: | ||
main: | ||
description: 'Main command/script.' | ||
required: true | ||
post: | ||
description: 'Post command/script.' | ||
required: true | ||
runs: | ||
using: 'node16' | ||
main: 'main.js' | ||
post: 'main.js' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// adapted from https://github.com/actions/runner/issues/1478 | ||
const { exec } = require("child_process"); | ||
|
||
function run(cmd) { | ||
exec(cmd, { shell: "bash" }, (error, stdout, stderr) => { | ||
if (stdout.length != 0) { | ||
console.log(`${stdout}`); | ||
} | ||
if (stderr.length != 0) { | ||
console.error(`${stderr}`); | ||
} | ||
if (error) { | ||
process.exitCode = error.code; | ||
console.error(`${error}`); | ||
} | ||
}); | ||
} | ||
|
||
if (process.env[`STATE_POST`] != undefined) { | ||
// Are we in the 'post' step? | ||
run(process.env.INPUT_POST); | ||
} else { | ||
// Otherwise, this is the main step | ||
console.log(`::save-state name=POST::true`); | ||
run(process.env.INPUT_MAIN); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
comment: false | ||
codecov: | ||
branch: main | ||
coverage: | ||
status: | ||
project: | ||
default: | ||
informational: true | ||
patch: | ||
default: | ||
informational: true | ||
flag_management: | ||
default_rules: # the rules that will be followed for any flag added, generally | ||
carryforward: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters