Skip to content

Commit 1472ea3

Browse files
committed
Add the macOS unit tests workflow
Signed-off-by: tdruez <[email protected]>
1 parent f8e4fea commit 1472ea3

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Run unit tests on macOS
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
push:
7+
branches:
8+
- main
9+
10+
env:
11+
POSTGRES_DB: scancodeio
12+
POSTGRES_USER: scancodeio
13+
POSTGRES_PASSWORD: scancodeio
14+
15+
jobs:
16+
macos-test:
17+
runs-on: macos-13
18+
19+
strategy:
20+
matrix:
21+
python-version: ["3.10", "3.11", "3.12", "3.13"]
22+
23+
steps:
24+
- name: Checkout code
25+
uses: actions/checkout@v4
26+
27+
- name: Set up Python ${{ matrix.python-version }}
28+
uses: actions/setup-python@v5
29+
with:
30+
python-version: ${{ matrix.python-version }}
31+
32+
- name: Install dependencies with Homebrew
33+
run: |
34+
brew update
35+
brew install universal-ctags gettext postgresql
36+
brew services start postgresql
37+
sleep 5
38+
createdb $POSTGRES_DB || echo "Database may already exist"
39+
40+
- name: Install Python dependencies
41+
run: make dev envfile
42+
43+
- name: Run Django tests
44+
run: .venv/bin/python manage.py test --verbosity=2 --noinput
45+
env:
46+
SCANCODEIO_DB_NAME: ${{ env.POSTGRES_DB }}
47+
SCANCODEIO_DB_USER: ${{ env.POSTGRES_USER }}
48+
SCANCODEIO_DB_PASSWORD: ${{ env.POSTGRES_PASSWORD }}

0 commit comments

Comments
 (0)