github/workflows: update the darwin build for setuptools
[git-cola.git] / .github / workflows / main.yml
blobfa28327d7fb215edc4ad79f7b118b938d97033af
1 name: CI
3 on: [push, pull_request]
5 jobs:
6   build:
7     name: 'Build'
8     runs-on: ubuntu-latest
9     steps:
10       - name: Checkout
11         uses: actions/checkout@v2
12         # Repository checked out under $GITHUB_WORKSPACE
14       - name: Install Dependencies
15         run: |
16           sudo apt-get update
17           sudo apt-get install \
18               gettext \
19               python3-sphinx
21       - name: Build
22         run: make prefix="build" install
24       - name: Upload Artifact
25         uses: actions/upload-artifact@v2
26         with:
27           name: git-cola-run${{github.run_number}}-${{runner.os}}
28           path: build/
30   test:
31     name: 'Test'
32     runs-on: ubuntu-latest
33     steps:
34       - name: Checkout
35         uses: actions/checkout@v2
36         # Repository checked out under $GITHUB_WORKSPACE
38       - name: Install Dependencies
39         run: |
40           set -x
41           sudo apt-get update
42           sudo apt-get install \
43               black \
44               gettext \
45               flake8 \
46               pylint \
47               python-is-python3 \
48               python-pytest \
49               python-setuptools-scm \
50               python3-pytest \
51               python3-pytest-flake8
52           # Runtime dependencies (required)
53           sudo apt-get install \
54               python3-qtpy \
55               python3-pyqt5
56           # Runtime dependencies (optional)
57           sudo apt-get install \
58               python3-send2trash
59           python -m venv --system-site-packages env
60           source env/bin/activate
61           export SETUPTOOLS_USE_DISTUTILS=stdlib
62           make develop
64       - name: Build Translations
65         run: |
66           source env/bin/activate
67           export SETUPTOOLS_USE_DISTUTILS=stdlib
68           make i18n
70       - name: Run Unit Tests
71         run: |
72           git config --global user.name "Git Cola"
73           git config --global user.email git-cola@localhost
74           export SETUPTOOLS_USE_DISTUTILS=stdlib
75           make test
77       - name: Run Linter
78         run: make pylint color=0
80       - name: Check Code Style
81         run: make flake8
83       - name: Check Code Formatting
84         # For strict adherence to formatting, run 'black' with --check
85         run: make format
87   win32:
88     name: 'Build / win32'
89     runs-on: windows-latest
90     steps:
91       - name: Checkout
92         uses: actions/checkout@v2
93         # Repository checked out under $GITHUB_WORKSPACE
95       - name: Setup Python
96         uses: actions/setup-python@v2
97         with:
98           python-version: '3.x'
99           architecture: 'x64'
101       - name: Pip Cache
102         uses: actions/cache@v2
103         with:
104             path: ~\AppData\Local\pip\Cache
105             key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements/requirements*.txt') }}
107       - name: Install Dependencies
108         run: |
109           pip install PyQt5
110           pip install qtpy
111           pip install --requirement requirements/requirements-dev.txt
112           pip install --requirement requirements/requirements-maint.txt
114       # Based on: contrib/win32/run-pynsist.sh
115       - name: Build Installer
116         run: |
117           make all
118           make doc
119           make htmldir="$PWD/share/doc/git-cola/html" install-doc
120           pynsist pynsist.cfg
121           rm -r share/doc/git-cola/html
123           # Rename executable output
124           cd build\nsis
125           mv git-cola*.exe git-cola-run${{github.run_number}}.exe
127       - name: Upload Artifact
128         uses: actions/upload-artifact@v2
129         with:
130           name: git-cola-run${{github.run_number}}-${{runner.os}}
131           path: build\nsis\git-cola*.exe
133   darwin:
134     name: 'Build / darwin'
135     runs-on: macos-latest
136     steps:
137       - name: Checkout
138         uses: actions/checkout@v2
139         # Repository checked out under $GITHUB_WORKSPACE
141       - name: Install Dependencies
142         run: |
143           set -x
144           brew install sphinx-doc
145           brew install git-cola
146           $(brew --prefix python3)/bin/python3 -m venv --system-site-packages env
147           source env/bin/activate
148           make requirements-dev
149           export SETUPTOOLS_USE_DISTUTILS=stdlib
150           make develop
152       - name: Build Bundle
153         run: |
154           set -x
155           source env/bin/activate
156           export SETUPTOOLS_USE_DISTUTILS=stdlib
157           mkdir build
158           make \
159             PYTHON_CONFIG=python3-config \
160             git-cola.app
161           mv git-cola.app build/
163       - name: Upload Artifact
164         uses: actions/upload-artifact@v2
165         with:
166           name: git-cola-run${{github.run_number}}-${{runner.os}}
167           path: build/