This repository has been archived by the owner on Jun 3, 2024. It is now read-only.
changes to deploy branch in integration #2543
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
name: Qwant Maps - CI | |
on: [push] | |
jobs: | |
Build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Init summary markown | |
run: echo '# πΊ Qwant Maps - Build summary' >> $GITHUB_STEP_SUMMARY | |
- name: Install system dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -yq libstdc++6 gettext jq | |
- uses: actions/checkout@v3 | |
- name: Use Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '16.14.2' | |
- name: Install NPM and npm dependencies | |
run: | | |
npm install -g npm@8.5.0 | |
npm ci | |
- name: Run build | |
run: | | |
TEST=true npm run build -- --mode=production | |
echo "- ## π€ Project build" >> $GITHUB_STEP_SUMMARY | |
echo "β Success" >> $GITHUB_STEP_SUMMARY | |
- name: Run ESLint | |
run: | | |
npm run lint | |
echo "- ## π€ ESLint" >> $GITHUB_STEP_SUMMARY | |
echo "β Success" >> $GITHUB_STEP_SUMMARY | |
- name: Run TypeScript migration files count | |
run: | | |
echo "- ## π€ TypeScript migration" >> $GITHUB_STEP_SUMMARY | |
npm run ts:count >> $GITHUB_STEP_SUMMARY | |
- name: Run TypeScript coverage | |
id: tscov | |
run: | | |
echo "- ## π€ TypeScript coverage" >> $GITHUB_STEP_SUMMARY | |
npm run ts:coverage | |
echo "π Total coverage: $(cat coverage-ts/typescript-coverage.json | jq '.percentage')% - Details: $(cat coverage-ts/typescript-coverage.json | jq '.covered')/$(cat coverage-ts/typescript-coverage.json | jq '.total') lines covered" >> $GITHUB_STEP_SUMMARY | |
- name: Run unit tests | |
run: | | |
npm run unit-test | |
echo "- ## π€ Unit tests" >> $GITHUB_STEP_SUMMARY | |
echo "β Success" >> $GITHUB_STEP_SUMMARY | |
echo "π Lines coverage: $(cat coverage/coverage-summary.json | jq '.total.lines.pct')% - Details: $(cat coverage/coverage-summary.json | jq '.total.lines.covered')/$(cat coverage/coverage-summary.json | jq '.total.lines.total') lines covered" >> $GITHUB_STEP_SUMMARY | |
echo "π Statements coverage: $(cat coverage/coverage-summary.json | jq '.total.statements.pct')% - Details: $(cat coverage/coverage-summary.json | jq '.total.statements.covered')/$(cat coverage/coverage-summary.json | jq '.total.statements.total') statements covered" >> $GITHUB_STEP_SUMMARY | |
echo "π Functions coverage: $(cat coverage/coverage-summary.json | jq '.total.functions.pct')% - Details: $(cat coverage/coverage-summary.json | jq '.total.functions.covered')/$(cat coverage/coverage-summary.json | jq '.total.functions.total') functions covered" >> $GITHUB_STEP_SUMMARY | |
echo "π Branches coverage: $(cat coverage/coverage-summary.json | jq '.total.branches.pct')% - Details: $(cat coverage/coverage-summary.json | jq '.total.branches.covered')/$(cat coverage/coverage-summary.json | jq '.total.branches.total') branches covered" >> $GITHUB_STEP_SUMMARY | |
- name: Run integration tests | |
run: | | |
npm run integration-test | |
echo "- ## π€ Integration tests" >> $GITHUB_STEP_SUMMARY | |
echo "β Success" >> $GITHUB_STEP_SUMMARY | |
- name: Deploy Storybook | |
if: "contains(github.ref_name, 'master')" | |
run: | | |
git remote set-url origin https://git:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git | |
npm run deploy-storybook -- -u "github-actions-bot <support+actions@github.com>" | |
echo "- ## π¨ Storybook" | |
echo "- β Successfully deployed to [https://qwant.github.io/erdapfel/](https://qwant.github.io/erdapfel/) π" >> $GITHUB_STEP_SUMMARY | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |