prog:githubactions
Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
prog:githubactions [2021/04/20 22:22] – Ajout de codecov.io root | prog:githubactions [2021/07/14 23:55] (Version actuelle) – [Variables] : ajout du code yaml pour afficher une variable du workflow root | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
- | ====Github actions==== | + | ====SSH==== |
===Ajout d'une clé SSH=== | ===Ajout d'une clé SSH=== | ||
Ligne 45: | Ligne 45: | ||
Sous Windows, '' | Sous Windows, '' | ||
+ | |||
+ | ====Serveurs==== | ||
===/ | ===/ | ||
Ligne 78: | Ligne 80: | ||
</ | </ | ||
- | ===Exemples=== | + | ===/ |
- | | + | <code bash> |
+ | ## Note, this file is written by cloud-init on first boot of an instance | ||
+ | ## modifications made here will not survive a re-bundle. | ||
+ | ## if you wish to make changes you can: | ||
+ | ## a.) add ' | ||
+ | ## or do the same in user-data | ||
+ | ## b.) add sources in / | ||
+ | ## c.) make changes to template file / | ||
+ | |||
+ | # See http:// | ||
+ | # newer versions of the distribution. | ||
+ | deb http:// | ||
+ | # deb-src http:// | ||
+ | |||
+ | ## Major bug fix updates produced after the final release of the | ||
+ | ## distribution. | ||
+ | deb http:// | ||
+ | # deb-src http:// | ||
+ | |||
+ | ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu | ||
+ | ## team. Also, please note that software in universe WILL NOT receive any | ||
+ | ## review or updates from the Ubuntu security team. | ||
+ | deb http:// | ||
+ | # deb-src http:// | ||
+ | deb http:// | ||
+ | # deb-src http:// | ||
+ | |||
+ | ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu | ||
+ | ## team, and may not be under a free licence. Please satisfy yourself as to | ||
+ | ## your rights to use the software. Also, please note that software in | ||
+ | ## multiverse WILL NOT receive any review or updates from the Ubuntu | ||
+ | ## security team. | ||
+ | deb http:// | ||
+ | # deb-src http:// | ||
+ | deb http:// | ||
+ | # deb-src http:// | ||
+ | |||
+ | ## N.B. software from this repository may not have been tested as | ||
+ | ## extensively as that contained in the main release, although it includes | ||
+ | ## newer versions of some applications which may provide useful features. | ||
+ | ## Also, please note that software in backports WILL NOT receive any review | ||
+ | ## or updates from the Ubuntu security team. | ||
+ | deb http:// | ||
+ | # deb-src http:// | ||
+ | |||
+ | ## Uncomment the following two lines to add software from Canonical' | ||
+ | ## ' | ||
+ | ## This software is not part of Ubuntu, but is offered by Canonical and the | ||
+ | ## respective vendors as a service to Ubuntu users. | ||
+ | # deb http:// | ||
+ | # deb-src http:// | ||
+ | |||
+ | deb http:// | ||
+ | # deb-src http:// | ||
+ | deb http:// | ||
+ | # deb-src http:// | ||
+ | deb http:// | ||
+ | # deb-src http:// | ||
+ | </ | ||
+ | |||
+ | ===env=== | ||
+ | |||
+ | Voir [[https:// | ||
+ | |||
+ | <code bash> | ||
+ | SELENIUM_JAR_PATH=/ | ||
+ | CONDA=/ | ||
+ | GITHUB_WORKSPACE=/ | ||
+ | JAVA_HOME_11_X64=/ | ||
+ | GITHUB_PATH=/ | ||
+ | GITHUB_ACTION=run2 | ||
+ | JAVA_HOME=/ | ||
+ | GITHUB_RUN_NUMBER=286 | ||
+ | GRADLE_HOME=/ | ||
+ | XDG_CONFIG_HOME=/ | ||
+ | DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 | ||
+ | ANT_HOME=/ | ||
+ | JAVA_HOME_8_X64=/ | ||
+ | HOMEBREW_PREFIX="/ | ||
+ | HOMEBREW_CLEANUP_PERIODIC_FULL_DAYS=3650 | ||
+ | BOOTSTRAP_HASKELL_NONINTERACTIVE=1 | ||
+ | *** | ||
+ | PIPX_BIN_DIR=/ | ||
+ | DEPLOYMENT_BASEPATH=/ | ||
+ | GITHUB_ACTIONS=true | ||
+ | ANDROID_NDK_LATEST_HOME=/ | ||
+ | GITHUB_SHA=5bcc406df60fcf617baec49cf66436cfac3f35d8 | ||
+ | POWERSHELL_DISTRIBUTION_CHANNEL=GitHub-Actions-ubuntu20 | ||
+ | DOTNET_MULTILEVEL_LOOKUP=0 | ||
+ | GITHUB_REF=refs/ | ||
+ | RUNNER_OS=Linux | ||
+ | HOME=/ | ||
+ | GITHUB_API_URL=https:// | ||
+ | LANG=C.UTF-8 | ||
+ | RUNNER_TRACKING_ID=github_0c419c59-170c-44ec-90e9-9b7328f5b6ba | ||
+ | RUNNER_TEMP=/ | ||
+ | GITHUB_ENV=/ | ||
+ | GITHUB_EVENT_PATH=/ | ||
+ | INVOCATION_ID=82c3e95da20a49b79e0f36288d8232d1 | ||
+ | GITHUB_EVENT_NAME=workflow_run | ||
+ | GITHUB_RUN_ID=976282352 | ||
+ | ANDROID_NDK_HOME=/ | ||
+ | HOMEBREW_NO_AUTO_UPDATE=1 | ||
+ | GITHUB_ACTOR=bansan85 | ||
+ | NVM_DIR=/ | ||
+ | ANDROID_HOME=/ | ||
+ | GOROOT_1_14_X64=/ | ||
+ | GITHUB_GRAPHQL_URL=https:// | ||
+ | RUNNER_USER=runner | ||
+ | ACCEPT_EULA=Y | ||
+ | USER=runner | ||
+ | GITHUB_SERVER_URL=https:// | ||
+ | HOMEBREW_CELLAR="/ | ||
+ | PIPX_HOME=/ | ||
+ | GECKOWEBDRIVER=/ | ||
+ | CHROMEWEBDRIVER=/ | ||
+ | SHLVL=1 | ||
+ | ANDROID_SDK_ROOT=/ | ||
+ | VCPKG_INSTALLATION_ROOT=/ | ||
+ | HOMEBREW_REPOSITORY="/ | ||
+ | RUNNER_TOOL_CACHE=/ | ||
+ | ImageVersion=20210614.1 | ||
+ | DOTNET_NOLOGO=1 | ||
+ | GRAALVM_11_ROOT=/ | ||
+ | GITHUB_JOB=build | ||
+ | AZURE_EXTENSION_DIR=/ | ||
+ | PERFLOG_LOCATION_SETTING=RUNNER_PERFLOG | ||
+ | GITHUB_REPOSITORY=bansan85/ | ||
+ | CHROME_BIN=/ | ||
+ | ANDROID_NDK_ROOT=/ | ||
+ | GITHUB_RETENTION_DAYS=90 | ||
+ | JOURNAL_STREAM=8: | ||
+ | RUNNER_WORKSPACE=/ | ||
+ | LEIN_HOME=/ | ||
+ | LEIN_JAR=/ | ||
+ | GITHUB_ACTION_REPOSITORY= | ||
+ | PATH=/ | ||
+ | RUNNER_PERFLOG=/ | ||
+ | GITHUB_BASE_REF= | ||
+ | CI=true | ||
+ | SWIFT_PATH=/ | ||
+ | ImageOS=ubuntu20 | ||
+ | GITHUB_REPOSITORY_OWNER=bansan85 | ||
+ | GITHUB_HEAD_REF= | ||
+ | GITHUB_ACTION_REF= | ||
+ | GITHUB_WORKFLOW=Emscripten | ||
+ | DEBIAN_FRONTEND=noninteractive | ||
+ | GOROOT_1_15_X64=/ | ||
+ | AGENT_TOOLSDIRECTORY=/ | ||
+ | GOROOT_1_16_X64=/ | ||
+ | _=/ | ||
+ | </ | ||
+ | |||
+ | ====Exemples==== | ||
+ | |||
+ | ===Projets en cmake=== | ||
- | En plus de cmake, il y a une procédure pour initialiser et commiter vers un dépôt externe. | + | En plus de la configuration / compilation / test avec cmake, il y a une procédure pour initialiser et commiter vers un dépôt externe. |
Sous Linux : | Sous Linux : | ||
Ligne 92: | Ligne 249: | ||
{{gh> | {{gh> | ||
+ | ====Variables==== | ||
- | ====Extensions==== | + | * Variable globale '' |
+ | |||
+ | '' | ||
+ | |||
+ | '' | ||
+ | |||
+ | Pour avoir la liste de tous les paramètres et leurs valeurs, on peut simplement ajouter dans un workflow : | ||
+ | |||
+ | <code yaml> | ||
+ | - name: Show github variable | ||
+ | env: | ||
+ | GITHUB_VAR: ${{ toJSON(github) }} | ||
+ | run: exit 0 | ||
+ | </ | ||
+ | |||
+ | [[https:// | ||
+ | |||
+ | * Variable globale de github et double quote | ||
+ | |||
+ | Certaines variables à l' | ||
+ | |||
+ | Cela pose un problème si on veut utiliser utiliser cette variable dans un script bash car il est impossible de faire une substitution des double quotes. | ||
+ | |||
+ | La solution est de passer par une variable d' | ||
+ | |||
+ | <code yaml> | ||
+ | - env: | ||
+ | COMMIT_MESSAGE: | ||
+ | run: | | ||
+ | echo " | ||
+ | </ | ||
+ | ====Fonctions==== | ||
+ | |||
+ | Quand on utilise une fonction, les variables n'ont pas à être '' | ||
+ | |||
+ | <code yaml> | ||
+ | if: contains(matrix.cc, | ||
+ | </ | ||
+ | |||
+ | Dans ce cas, il n'est plus possible d' | ||
+ | |||
+ | <code yaml> | ||
+ | if: contains( format(' | ||
+ | </ | ||
+ | |||
+ | [[https:// | ||
+ | ====Marketplace==== | ||
===codecov=== | ===codecov=== | ||
Ligne 108: | Ligne 312: | ||
Le badge par défaut : [[https:// | Le badge par défaut : [[https:// | ||
- | * Flags | + | * Flags coté validation github |
Les flags peuvent se définir de deux façons différentes. Soit les flags pour la validation des build Github, soit les flags pour le badge. | Les flags peuvent se définir de deux façons différentes. Soit les flags pour la validation des build Github, soit les flags pour le badge. | ||
Ligne 129: | Ligne 333: | ||
{{: | {{: | ||
+ | |||
+ | Il est possible de désactiver la validation d'une build en fonction des indicateurs de couverture. | ||
+ | |||
+ | <file yaml .codecov.yml> | ||
+ | --- | ||
+ | coverage: | ||
+ | status: | ||
+ | patch: false | ||
+ | project: false | ||
+ | </ | ||
+ | |||
+ | * Flags coté badge | ||
Par contre, les flags ne fonctionnent pas avec les badges. Pour les faire fonctionner, | Par contre, les flags ne fonctionnent pas avec les badges. Pour les faire fonctionner, |
prog/githubactions.1618950122.txt.gz · Dernière modification : 2021/04/20 22:22 de root