generated from actions/typescript-action
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
124 additions
and
128 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,28 +1,29 @@ | ||
import * as core from "@actions/core"; | ||
import {exec} from "@actions/exec"; | ||
|
||
const prepare = async (): Promise<void> => | ||
core.group("Prepare environment", async () => { | ||
const prepare = async (): Promise<void> => { | ||
core.startGroup("Prepare environment"); | ||
try { | ||
await exec("sudo apt-get install -y valgrind", [], { | ||
silent: true, | ||
}); | ||
try { | ||
await exec("sudo apt-get install -y valgrind", [], { | ||
await exec("pip show pytest-codspeed", [], { | ||
silent: true, | ||
}); | ||
} catch (e) { | ||
core.warning( | ||
"pytest-codspeed is not installed in your environment. Installing it..." | ||
); | ||
await exec("pip install pytest-codspeed", [], { | ||
silent: true, | ||
}); | ||
try { | ||
await exec("pip show pytest-codspeed", [], { | ||
silent: true, | ||
}); | ||
} catch (e) { | ||
core.warning( | ||
"pytest-codspeed is not installed in your environment. Installing it..." | ||
); | ||
await exec("pip install pytest-codspeed", [], { | ||
silent: true, | ||
}); | ||
} | ||
} catch (error) { | ||
throw new Error(`Failed to prepare environment: ${error}`); | ||
} | ||
core.info("Environment ready"); | ||
}); | ||
} catch (error) { | ||
throw new Error(`Failed to prepare environment: ${error}`); | ||
} | ||
core.info("Environment ready"); | ||
core.endGroup(); | ||
}; | ||
|
||
export default prepare; |
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