forked from openfoodfacts/openfoodfacts-server
-
Notifications
You must be signed in to change notification settings - Fork 0
108 lines (100 loc) · 2.69 KB
/
pull_request.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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
name: Pull Requests
on:
pull_request:
jobs:
# those are just until we de-activate their mandatory
gulp:
name: Gulp
runs-on: ubuntu-latest
steps:
- name: just finish
run: exit 0
dev:
name: Dev
runs-on: ubuntu-latest
steps:
- name: just finish
run: exit 0
lint:
name: NPM lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1
- uses: actions/setup-node@v3
with:
node-version: '12.x'
- name: gulp build
run: make front_build
- name: lint
run: make front_lint
# this will build the docker image and upload as an artifact for following jobs
build_backend:
name: Build backend dev image for tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 50
- name: build
run: make build_backend
- name: push backend image as artifact
uses: ishworkh/docker-image-artifact-upload@v1
with:
image: "openfoodfacts-server/backend:dev"
check_perl:
name: Check perl
needs: build_backend
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 50
- name: Download backend image from artifacts
uses: ishworkh/docker-image-artifact-download@v1
with:
image: "openfoodfacts-server/backend:dev"
- name: ensure branch origin/main is fetched
run: git fetch --no-tags --prune --progress --no-recurse-submodules --depth=5 origin main
- name: check perltidy
run: make check_perltidy
- name: check perlcritic
run: make check_critic
- name: check perl
run: make check_perl
tests:
name: Perl unit tests
needs: build_backend
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 50
- name: Download backend image from artifacts
uses: ishworkh/docker-image-artifact-download@v1
with:
image: "openfoodfacts-server/backend:dev"
- name: rebuild taxonomies
# here we first restore dates from git for taxonomies to avoid build them all
# see https://stackoverflow.com/a/60984318/2886726
run: |
git ls-files taxonomies/ | xargs -I{} git log -1 --date=format:%Y%m%d%H%M.%S --format='touch -t %ad "{}"' "{}" | bash
make build_taxonomies
- name: test
run: make tests
tests_dev:
name: Test make dev
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 50
- name: Test make dev
run: |
make dev
make status
- name: test all is running
run: make livecheck
- name: test clean
run: make hdown