-
Notifications
You must be signed in to change notification settings - Fork 255
162 lines (144 loc) · 5.94 KB
/
ubuntu24.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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
name: Build Community with ubuntu-24
on:
push:
paths-ignore:
- "doc/**"
- "*.md"
- ".vscode/**"
- ".devcontainer/**"
- ".gitignore"
- ".gitattributes"
- ".gitmodules"
- ".clang-format"
- "translations.sh"
pull_request:
repository_dispatch:
types: [odoo_connector]
workflow_dispatch:
env:
BUILD_TYPE: Release
jobs:
build:
runs-on: ubuntu-24.04
services:
postgres:
image: postgres:13
env:
POSTGRES_USER: frepple
POSTGRES_PASSWORD: frepple
POSTGRES_DB: postgres
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checking out source code
uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up Nodes
uses: actions/setup-node@v4
- name: Install packages
run: |
sudo apt update
sudo apt install --no-upgrade libxerces-c-dev openssl libssl-dev libpq5 libpq-dev postgresql-client python3 python3-dev python3-venv python3-setuptools
npm ci
- name: Build
run: |
git submodule update --remote --checkout --force
grunt
cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --target package -- -j 4
cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --target doc
cp djangosettings.py djangosettings.original.py
. ${{github.workspace}}/venv/bin/activate
echo "PATH=$PATH" >> $GITHUB_ENV
echo "VIRTUAL_ENV=$VIRTUAL_ENV" >> $GITHUB_ENV
- name: Test
working-directory: ${{github.workspace}}
run: |
export POSTGRES_HOST=localhost
export POSTGRES_PORT=5432
export FREPPLE_DATE_STYLE="day-month-year"
./test/runtest.py --regression
./frepplectl.py test freppledb --verbosity=2
- name: Test uninstalling apps
working-directory: ${{github.workspace}}
run: |
export POSTGRES_HOST=localhost
export POSTGRES_PORT=5432
./frepplectl.py createdatabase --noinput
./frepplectl.py migrate
./frepplectl.py migrate forecast zero
./frepplectl.py migrate wizard zero
./frepplectl.py migrate metrics zero
./frepplectl.py migrate reportmanager zero
./frepplectl.py migrate executesql zero
- name: Odoo integration test
if: github.event.client_payload.message.branch
run: |
# First make the checkout unshallow
git -C freppledb/odoo/odoo_addon remote set-branches origin '*'
git -C freppledb/odoo/odoo_addon fetch --all
git -C freppledb/odoo/odoo_addon checkout "remotes/origin/${{ github.event.client_payload.message.branch }}"
sed -i 's/# "freppledb.odoo"/"freppledb.odoo"/g' djangosettings.py
export POSTGRES_HOST=localhost
export POSTGRES_PORT=5432
./frepplectl.py test freppledb.odoo
- name: "Keep logs"
uses: actions/upload-artifact@v4
if: ${{ failure() }}
with:
name: test_logs
path: logs
retention-days: 1
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Grunt to compile and minify css and javascript files
file_pattern: "*.min.*"
- name: Get the version
if: startsWith(github.ref, 'refs/tags/') && github.repository == 'frePPLe/frepple'
working-directory: ${{github.workspace}}/build
run: |
echo "frepple_version=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
echo `cmake --system-information | grep 'CMAKE_PROJECT_VERSION:STATIC' | sed 's/CMAKE_PROJECT_VERSION:STATIC/project_version/g'` >> $GITHUB_ENV
- name: Check the version
if: startsWith(github.ref, 'refs/tags/') && github.repository == 'frePPLe/frepple-enterprise-dev'
run: |
if [ "${{ env.frepple_version }}" != "${{ env.project_version }}" ]; then
exit 1
fi
- name: Login to GitHub Container Registry
if: startsWith(github.ref, 'refs/tags/') && github.repository == 'frePPLe/frepple'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push docker image
if: startsWith(github.ref, 'refs/tags/') && github.repository == 'frePPLe/frepple'
run: |
mv djangosettings.original.py djangosettings.py
cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --target docker
docker tag ghcr.io/frepple/frepple-community:${{ env.frepple_version }} ghcr.io/frepple/frepple-community:latest
docker push ghcr.io/frepple/frepple-community:${{ env.frepple_version }}
docker push ghcr.io/frepple/frepple-community:latest
- name: Publish release
if: startsWith(github.ref, 'refs/tags/') && github.repository == 'frePPLe/frepple'
uses: softprops/action-gh-release@v2
with:
name: "${{ env.frepple_version }} Community Edition"
body: |
Release notes are available on https://frepple.com/docs/current/release-notes.html
**docker container**\: Docker pull ghcr.io/frepple/frepple:${{ env.frepple_version }}
**ubuntu24-frepple-${{ env.frepple_version }}.deb**\: Installer for Ubuntu 24.04 LTS
**frepple-doc-${{ env.frepple_version }}.tgz**\: Documentation
files: |
${{github.workspace}}/build/contrib/docker/*.deb
${{github.workspace}}/build/frepple-doc-*.tgz
make_latest: ${{ endsWith(github.ref, '.0') }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}