prog:githubactions
Différences
Ci-dessous, les différences entre deux révisions de la page.
Prochaine révision | Révision précédente | ||
prog:githubactions [2020/11/22 18:12] – Création avec "Ajout d'une clé SSH" 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: | ||
+ | ====SSH==== | ||
===Ajout d'une clé SSH=== | ===Ajout d'une clé SSH=== | ||
Ligne 5: | Ligne 6: | ||
* Création de la clé | * Création de la clé | ||
- | Il faut commencer par [[prog: | + | Il faut commencer par [[prog: |
* Ajout de la clé au dépôt à modifier | * Ajout de la clé au dépôt à modifier | ||
Ligne 12: | Ligne 13: | ||
{{: | {{: | ||
+ | |||
+ | Bien sûr, cocher '' | ||
* Ajout de la clé au dépôt voulant pousser vers le dépôt à modifier | * Ajout de la clé au dépôt voulant pousser vers le dépôt à modifier | ||
Ligne 40: | Ligne 43: | ||
git push | git push | ||
</ | </ | ||
+ | |||
+ | Sous Windows, '' | ||
+ | |||
+ | ====Serveurs==== | ||
+ | ===/ | ||
+ | |||
+ | 2 processeurs : | ||
+ | |||
+ | < | ||
+ | processor : 1 et 2 | ||
+ | vendor_id : GenuineIntel | ||
+ | cpu family : 6 | ||
+ | model : 79 | ||
+ | model name : Intel(R) Xeon(R) CPU E5-2673 v4 @ 2.30GHz | ||
+ | stepping : 1 | ||
+ | microcode : 0xffffffff | ||
+ | cpu MHz : 2294.686 | ||
+ | cache size : 51200 KB | ||
+ | physical id : 0 | ||
+ | siblings : 2 | ||
+ | core id : 0 | ||
+ | cpu cores : 2 | ||
+ | apicid : 0 | ||
+ | initial apicid : 0 | ||
+ | fpu : yes | ||
+ | fpu_exception : | ||
+ | cpuid level : 20 | ||
+ | wp : yes | ||
+ | flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc rep_good nopl xtopology cpuid pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch invpcid_single pti fsgsbase bmi1 hle avx2 smep bmi2 erms invpcid rtm rdseed adx smap xsaveopt md_clear | ||
+ | bugs : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs taa itlb_multihit | ||
+ | bogomips : 4589.37 | ||
+ | clflush size : 64 | ||
+ | cache_alignment : | ||
+ | address sizes : 46 bits physical, 48 bits virtual | ||
+ | power management: | ||
+ | </ | ||
+ | |||
+ | ===/ | ||
+ | |||
+ | <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 la configuration / compilation / test avec cmake, il y a une procédure pour initialiser et commiter vers un dépôt externe. | ||
+ | |||
+ | Sous Linux : | ||
+ | |||
+ | {{gh> | ||
+ | |||
+ | Sous Windows, inclus vcpkg : | ||
+ | |||
+ | {{gh> | ||
+ | |||
+ | ====Variables==== | ||
+ | |||
+ | * 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=== | ||
+ | |||
+ | Envoyer les données à codecov : | ||
+ | |||
+ | <code bash> | ||
+ | git clone --depth 1 https:// | ||
+ | ./ | ||
+ | ./ | ||
+ | bash <(curl -s https:// | ||
+ | </ | ||
+ | |||
+ | Le badge par défaut : [[https:// | ||
+ | |||
+ | * 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. | ||
+ | |||
+ | Pour la validation des build Github, un simple fichier de configuration est possible. Il va s' | ||
+ | |||
+ | <file yaml .codecov.yml> | ||
+ | --- | ||
+ | coverage: | ||
+ | status: | ||
+ | project: | ||
+ | backend: | ||
+ | target: auto | ||
+ | paths: | ||
+ | - src/backend | ||
+ | - include/ | ||
+ | </ | ||
+ | |||
+ | Cela va bien ajouter une ligne. Exemple ci-dessous avec '' | ||
+ | |||
+ | {{: | ||
+ | |||
+ | 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, | ||
+ | |||
+ | <code bash> | ||
+ | git clone --depth 1 https:// | ||
+ | ./ | ||
+ | ./ | ||
+ | bash <(curl -s https:// | ||
+ | ./ | ||
+ | bash <(curl -s https:// | ||
+ | </ | ||
+ | |||
+ | Là, le badge '' |
prog/githubactions.1606065138.txt.gz · Dernière modification : 2020/11/22 18:12 de root