This repository has been archived by the owner on Jun 3, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 28
79 lines (64 loc) · 3.66 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
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 }}