Repository navigation
116 lines (101 loc) · 3.59 KB
/
Copy pathdebug.yml
File metadata and controls
116 lines (101 loc) · 3.59 KB
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
name: Debug
on: workflow_dispatch
permissions:
contents: read
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, windows-latest]
python-version: ['3.7', ]
include:
- os: ubuntu-20.04
poetry_version: '1.3.1'
poetry_home: ''
poetry_path: ''
poetry_cache_paths: |
~/.local/share/pypoetry
~/.local/bin/poetry
- os: windows-latest
poetry_version: '1.3.1'
poetry_home: ''
#poetry_path: ${APPDATA}\pypoetry\venv\Scripts
poetry_path: ${APPDATA}\Python\Scripts
poetry_cache_paths: |
~\AppData\Roaming\pypoetry
~\AppData\Roaming\Python\Scripts\poetry.exe
#- os: windows-latest
# poetry_home: ~\.local
# poetry_path: ${USERPROFILE}\.local\venv\Scripts
# #poetry_path: ${USERPROFILE}\.local\bin
# poetry_cache_paths: |
# ~\.local\VERSION
# #~\.local\bin\poetry.exe
# ~\.local\venv
runs-on: ${{ matrix.os }}
steps:
- name: Debug
shell: bash
run: python -V
- name: Checkout
uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Load cached Poetry installation
id: cached-poetry
uses: actions/cache@v3
with:
path: ${{ matrix.poetry_cache_paths }}
key: temp-poetry-${{ matrix.poetry_version }}-${{ matrix.os }}-python-${{ matrix.python-version }}
- name: Install Poetry for Linux/macOS
if: runner.os != 'Windows' && steps.cached-poetry.outputs.cache-hit != 'true'
shell: bash
env:
POETRY_VERSION: ${{ matrix.poetry_version }}
POETRY_HOME: ${{ matrix.poetry_home }}
run: |
curl -sSL https://install.python-poetry.org | python3 -
- name: Install Poetry for Windows
if: runner.os == 'Windows' && steps.cached-poetry.outputs.cache-hit != 'true'
shell: pwsh
env:
POETRY_VERSION: ${{ matrix.poetry_version }}
POETRY_HOME: ${{ matrix.poetry_home }}
run: |
(Invoke-WebRequest -Uri https://install.python-poetry.org -UseBasicParsing).Content | py -
- name: Add Poetry to the PATH environment variable
if: matrix.poetry_path != ''
shell: bash
run: |
echo "${{ matrix.poetry_path }}" >> $GITHUB_PATH
- name: Configure Poetry
run: |
poetry config virtualenvs.in-project true
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v3
with:
path: .venv
key: temp-venv-${{ matrix.os }}-python-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root --with dev
- name: Install project
run: poetry install --no-interaction --only-root
- name: Debug
shell: bash
run: printenv
- name: Test with pytest
shell: bash
run: |
if [ $RUNNER_OS == 'Windows' ]; then
# Avoid referencing the wrong Python version.
VER='${{ matrix.python-version }}'
ARR=(${VER//./ })
poetry run tox -e "py${ARR[0]}${ARR[1]}"
else
poetry run tox -e py
fi