Skip to content

Commit 644c442

Browse files
FelixAbrahamssonFelixAbrahamsson
authored andcommitted
build: fix github actions
1 parent a901665 commit 644c442

File tree

2 files changed

+72
-74
lines changed

2 files changed

+72
-74
lines changed

.github/workflows/publish.yml

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -8,32 +8,32 @@ jobs:
88
publish:
99
runs-on: ubuntu-latest
1010
steps:
11-
- uses: actions/checkout@v2
12-
- name: Set up Python
13-
uses: actions/setup-python@v2
14-
with:
15-
python-version: '3.8'
16-
- name: Install dependencies
17-
run: |
18-
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python
19-
source $HOME/.poetry/env
20-
poetry install
11+
- name: Set PATH
12+
run: echo "${HOME}/.local/bin" >> $GITHUB_PATH
2113

22-
- name: Run tests
23-
run: |
24-
source $HOME/.poetry/env
25-
poetry run pytest
14+
- uses: actions/checkout@v2
15+
- name: Set up Python
16+
uses: actions/setup-python@v2
17+
with:
18+
python-version: "3.8"
2619

27-
- name: Build wheels
28-
run: |
29-
source $HOME/.poetry/env
30-
poetry version $(git tag --points-at HEAD)
31-
poetry build
20+
- name: Install dependencies
21+
run: |
22+
curl -sSL https://install.python-poetry.org | python - --version 1.2.2
23+
poetry install
3224
33-
- name: Upload
34-
env:
35-
USERNAME: __token__
36-
PASSWORD: ${{ secrets.PYPI_TOKEN }}
37-
run: |
38-
source $HOME/.poetry/env
39-
poetry publish --username=$USERNAME --password=$PASSWORD
25+
- name: Run tests
26+
run: |
27+
poetry run pytest
28+
29+
- name: Build wheels
30+
run: |
31+
poetry version $(git tag --points-at HEAD)
32+
poetry build
33+
34+
- name: Upload
35+
env:
36+
USERNAME: __token__
37+
PASSWORD: ${{ secrets.PYPI_TOKEN }}
38+
run: |
39+
poetry publish --username=$USERNAME --password=$PASSWORD

.github/workflows/test.yml

Lines changed: 46 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -4,72 +4,70 @@ on: [push]
44

55
jobs:
66
test:
7-
87
runs-on: ubuntu-latest
98
strategy:
109
matrix:
1110
python-version: [3.8]
1211

1312
steps:
14-
- uses: actions/checkout@v2
15-
- name: Set up Python ${{ matrix.python-version }}
16-
uses: actions/setup-python@v2
17-
with:
18-
python-version: ${{ matrix.python-version }}
13+
- name: Set PATH
14+
run: echo "${HOME}/.local/bin" >> $GITHUB_PATH
1915

20-
- name: Cache pip
21-
uses: actions/cache@v2
22-
with:
23-
path: ~/.cache/pip
24-
key: ${{ runner.os }}-pip-${{ hashFiles('pyproject.toml') }}-${{ hashFiles('poetry.lock') }}-${ GITHUB_REF }
25-
restore-keys: |
26-
${{ runner.os }}-pip-
27-
${{ runner.os }}-
16+
- uses: actions/checkout@v2
17+
- name: Set up Python ${{ matrix.python-version }}
18+
uses: actions/setup-python@v2
19+
with:
20+
python-version: ${{ matrix.python-version }}
2821

29-
- name: Install dependencies
30-
run: |
31-
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python
32-
source $HOME/.poetry/env
33-
poetry install
22+
- name: Cache pip
23+
uses: actions/cache@v2
24+
with:
25+
path: ~/.cache/pip
26+
key: ${{ runner.os }}-pip-${{ hashFiles('pyproject.toml') }}-${{ hashFiles('poetry.lock') }}-${ GITHUB_REF }
27+
restore-keys: |
28+
${{ runner.os }}-pip-
29+
${{ runner.os }}-
3430
35-
- name: Run tests
36-
run: |
37-
source $HOME/.poetry/env
38-
poetry run pytest
31+
- name: Install dependencies
32+
run: |
33+
curl -sSL https://install.python-poetry.org | python - --version 1.2.2
34+
poetry install
3935
40-
- name: Build wheels
41-
run: |
42-
source $HOME/.poetry/env
43-
poetry build
36+
- name: Run tests
37+
run: |
38+
poetry run pytest
4439
45-
build-docs:
40+
- name: Build wheels
41+
run: |
42+
poetry build
4643
44+
build-docs:
4745
runs-on: ubuntu-latest
4846
strategy:
4947
matrix:
5048
python-version: [3.8]
5149

5250
steps:
53-
- uses: actions/checkout@v2
54-
- name: Set up Python ${{ matrix.python-version }}
55-
uses: actions/setup-python@v2
56-
with:
57-
python-version: ${{ matrix.python-version }}
51+
- uses: actions/checkout@v2
52+
- name: Set up Python ${{ matrix.python-version }}
53+
uses: actions/setup-python@v2
54+
with:
55+
python-version: ${{ matrix.python-version }}
5856

59-
- name: Cache pip
60-
uses: actions/cache@v2
61-
with:
62-
path: ~/.cache/pip
63-
key: ${{ runner.os }}-pip-${{ hashFiles('docs/source/requirements.txt') }}-${ GITHUB_REF }
64-
restore-keys: |
65-
${{ runner.os }}-pip-
66-
${{ runner.os }}-
57+
- name: Cache pip
58+
uses: actions/cache@v2
59+
with:
60+
path: ~/.cache/pip
61+
key: ${{ runner.os }}-pip-${{ hashFiles('docs/source/requirements.txt') }}-${ GITHUB_REF }
62+
restore-keys: |
63+
${{ runner.os }}-pip-
64+
${{ runner.os }}-
6765
68-
- name: Install dependencies
69-
run: |
70-
python -m pip install --upgrade pip
71-
pip install -r docs/source/requirements.txt
66+
- name: Install dependencies
67+
run: |
68+
python -m pip install --upgrade pip
69+
pip install -r docs/source/requirements.txt
7270
73-
- name: Build html
74-
run: |
75-
(cd docs && make html)
71+
- name: Build html
72+
run: |
73+
(cd docs && make html)

0 commit comments

Comments
 (0)