Skip to content

Hotfix \ valeur par défaut voiture . utilisateur régulier à non #1341

Hotfix \ valeur par défaut voiture . utilisateur régulier à non

Hotfix \ valeur par défaut voiture . utilisateur régulier à non #1341

# Generates an artifact containing the result of the `yarn compile` command.
name: Generate PR artifact
on:
pull_request:
types: [opened, synchronize]
push:
branches:
- '!master'
jobs:
compile:
runs-on: ubuntu-22.04
outputs:
compilation-result: ${{ steps.compilation.outputs.result }}
check-translation-result: ${{ steps.check-translation.outputs.result }}
check-personas-result: ${{ steps.check-personas.outputs.result }}
test-personas-result: ${{ steps.test-personas.outputs.result }}
test-optim-result: ${{ steps.test-optim.outputs.result }}
test-url: ${{ steps.set-test-url.outputs.fr }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
cache: 'yarn'
- run: yarn install --immutable
- run: git log | head && git status
- id: compilation
run: |
# Compiles the model and stores the result -- with escaped special characters.
yarn compile:md > compile.res
body="$(cat compile.res | tail --lines=+3 | head --lines=-1)"
body="${body//'%'/'%25'}"
body="${body//$'\n'/'%0A'}"
body="${body//$'\r'/'%0D'}"
echo "::set-output name=result::${body}"
- id: check-translation
run: |
# Checks the rules translation
yarn check:rules --markdown > check-rules.res
body="$(cat check-rules.res | tail --lines=+3 | head --lines=-1)"
body="${body//'%'/'%25'}"
body="${body//$'\n'/'%0A'}"
body="${body//$'\r'/'%0D'}"
echo "::set-output name=result::${body}"
- id: check-personas
run: |
# Checks the personas translation
yarn check:personas --markdown > check-personas.res
body="$(cat check-personas.res | tail --lines=+3 | head --lines=-1)"
body="${body//'%'/'%25'}"
body="${body//$'\n'/'%0A'}"
body="${body//$'\r'/'%0D'}"
echo "::set-output name=result::${body}"
- id: test-personas
run: |
# Test the personas bilans against production
yarn test:personas --markdown > test-personas.res
body="$(cat test-personas.res | tail --lines=+3 | head --lines=-1)"
body="${body//'%'/'%25'}"
body="${body//$'\n'/'%0A'}"
body="${body//$'\r'/'%0D'}"
echo "::set-output name=result::${body}"
- id: test-optim
run: |
# Test the personas bilans against production
yarn test:optim --markdown > test-optim.res
body="$(cat test-optim.res | tail --lines=+3 | head --lines=-1)"
body="${body//'%'/'%25'}"
body="${body//$'\n'/'%0A'}"
body="${body//$'\r'/'%0D'}"
echo "::set-output name=result::${body}"
- id: set-test-url
# Setups the NGC url with the corresponding PR number: https://nosgestesclimat.fr?PR=<pr_number>
run: echo "::set-output name=fr::${{ steps.deploy-env.outputs.name == 'master' && 'https://nosgestesclimat.fr' || format('https://nosgestesclimat.fr?PR={0}', github.event.pull_request.number) }}"
upload-artifact:
runs-on: ubuntu-22.04
needs: compile
steps:
- name: Create artifact
run: |
mkdir -p artifacts
echo "
<h1 align="center">Report for the pull request #${{ github.event.pull_request.number }}</h2>
<p align="center">:rocket: Test the model from the website: <a href=\"${{ needs.compile.outputs.test-url }}\">${{ needs.compile.outputs.test-url }}</a></p>
---
### :wrench: Model compilation status
${{ needs.compile.outputs.compilation-result }}
---
### :globe_with_meridians: Translation status
#### Rules
${{ needs.compile.outputs.check-translation-result }}
#### Personas
${{ needs.compile.outputs.check-personas-result }}
> _You will find more information about the translation in the [dedicated file](https:/github.com/datagir/nosgestesclimat/blob/master/docs/translation.md)._
---
### :couple: Personas changes
${{ needs.compile.outputs.test-personas-result }}
${{ needs.compile.outputs.test-optim-result }}
" > artifacts/result.md
- name: Upload artifact
uses: actions/upload-artifact@v1
with:
name: pr_message
path: artifacts