forked from django-salesforce/django-salesforce
-
-
Notifications
You must be signed in to change notification settings - Fork 1
56 lines (52 loc) · 1.9 KB
/
main.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
name: django-salesforce test
on:
push:
branches: [ 'actions*', main ]
# pull_request:
# branches: [ main ]
# # prefer to teminate some queued jobs only manually, "max-parallel: 1" works enough
# concurrency:
# group: one-job-at-a-time
# cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
strategy:
max-parallel: 1
matrix:
python-version: [3.8, 3.12, 3.11, "3.10", 3.9]
timeout-minutes: 20
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies, Customize local_settings
run: |
python${{ matrix.python-version }} -V
pip install --upgrade pip
pip install tox
# this should be used only for a capitalized primary key 'Id' with migrations
# sed -i -e "s/'id', salesforce/'Id', salesforce/" salesforce/testrunner/example/migrations/0*.py
- name: Run Tests
env:
DJSF_LICENSE_KEY: ${{ secrets.DJSF_LICENSE_KEY }}
SF_CONSUMER_KEY: ${{ secrets.SF_CONSUMER_KEY }}
SF_CONSUMER_SECRET: ${{ secrets.SF_CONSUMER_SECRET }}
SF_USER: ${{ secrets.SF_USER }}
SF_PASSWORD: ${{ secrets.SF_PASSWORD }}
SF_HOST: ${{ secrets.SF_HOST }}
TOXENV_38: "docs_style,typing,clean,dj22-py38,dj21-py38"
TOXENV_312: "dj50-py312"
TOXENV_311: "dj42-py311"
TOXENV_310: "dj40-py310"
TOXENV_39: "no_django-py39,debug_toolbar-dj42-py39,dj32-py39,dj30-py39"
run: |
TOXENV_NAME=$(echo TOXENV_${{ matrix.python-version }} | sed 's/\.//')
cat > salesforce/testrunner/local_settings.py <<'-- end local_settings --'
SF_PK = 'Id'
SF_LAZY_CONNECT = False
-- end local_settings --
echo "tox -e ${!TOXENV_NAME}"
tox -e ${!TOXENV_NAME} --colored yes