97 lines (83 loc) · 3.1 KB
/
ci.yaml
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
---
name: Continuous integration
on:
push:
jobs:
main:
runs-on: ubuntu-18.04
name: Continuous integration
timeout-minutes: 30
env:
MAIN_BRANCH: 2.5
CI: true
PATH: /bin:/usr/bin:/usr/local/bin:/home/runner/.local/bin
SUMMON_PROVIDER: /usr/local/bin/gopass
steps:
- run: python3 --version
- run: python3 -m pip --version
- run: /opt/google/chrome/chrome --version
- uses: actions/setup-node@v1
with:
node-version: '10.x'
- run: node --version
- run: npm --version
- run: sudo apt update
- run: sudo apt install g++-4.8 python3-venv graphicsmagick fonts-liberation2
- uses: actions/checkout@v1
- run: git config --global user.name "Continuous integration"
- run: git config --global user.email "ci@comptocamp.org"
- run: ls -al
- run: buildtools/set-version
# Lint
- run: make lint
- run: make spell
- run: make check-examples-checker
- run: make test
# Webpack build of ngeo/gmf examples and gmf apps
- run: NODE_ENV=production make examples-hosted
- run: make check-examples
- uses: actions/upload-artifact@v1
with:
name: Examples hosted
path: .build/examples-hosted
if: failure()
#- run: npm run typecheck
- run: "! (npm run typecheck|grep -v '^node_modules/'|grep '^[a-z]')"
# Generate API doc
- run: npm run doc
- run: npm run jsdoc
- run: npm run build-api
- uses: actions/upload-artifact@v1
with:
name: Npm logs
path: /home/runner/.npm/_logs
if: failure()
- uses: camptocamp/initialise-gopass-summon-action@v1
with:
ci-gpg-private-key: ${{secrets.CI_GPG_PRIVATE_KEY}}
github-gopass-ci-token: ${{secrets.GITHUB_GOPASS_CI_TOKEN}}
if: github.repository == 'camptocamp/ngeo'
- run: echo "//registry.npmjs.org/:_authToken=$(gopass gs/ci/npm/token)" > ~/.npmrc
if: github.repository == 'camptocamp/ngeo'
- name: Build ~/.transifexrc
run: |
summon --yaml '
USERNAME: !var gs/ci/transifex/rw/username
PASSWORD: !var gs/ci/transifex/rw/password
' bash -c 'envsubst < buildtools/transifexrc.tmpl > ~/.transifexrc'
if: github.repository == 'camptocamp/ngeo'
- run: make transifex-send
if: github.repository == 'camptocamp/ngeo' && github.ref == format('refs/heads/{0}', env.MAIN_BRANCH)
- run: buildtools/publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: github.repository == 'camptocamp/ngeo'
- run: buildtools/npm-publish
if: github.repository == 'camptocamp/ngeo'
- name: Notify c2cgeoportal
run: >
curl --request POST --header "Content-Type: application/json"
--header 'Accept: application/vnd.github.groot-preview+json'
--header "Authorization: token ${{ env.GITHUB_GOPASS_CI_TOKEN }}"
https://api.github.com/repos/camptocamp/c2cgeoportal/dispatches
--data '{"event_type": "ngeo_25_updated"}'