generated from pythoninthegrasses/python_template
-
-
Notifications
You must be signed in to change notification settings - Fork 2
57 lines (50 loc) · 1.59 KB
/
run_script.yml
File metadata and controls
57 lines (50 loc) · 1.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
# https://github.com/actions/setup-python/blob/main/docs/advanced-usage.md#caching-packages
name: run_script
on: [workflow_dispatch] # pull_request, push, workflow_dispatch
jobs:
ci:
strategy:
fail-fast: false
matrix:
# hard-coded versions
# python-version: ["3.10.5"]
# poetry-version: ["1.1.13"]
os: [ubuntu-latest]
arch: ['x64']
runs-on: ${{ matrix.os }}
steps:
- name: checkout repo content
uses: actions/checkout@v3
- name: Read .tool-versions # dynamic versions
uses: marocchino/tool-versions-action@v1
id: versions
- name: setup python
uses: actions/setup-python@v4
id: cp310
with:
python-version: ${{ steps.versions.outputs.python }}
architecture: ${{ matrix.arch }}
cache: 'poetry' # cache dependencies
- run: echo '${{ steps.cp310.outputs.cache-hit }}' # true if cache-hit occured on the primary key
- name: Install poetry & dependencies
run: |
python -m pip install --upgrade pip
python -m pip install poetry
poetry install
- name: run script
shell: bash
env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # gh cli
username: ${{ secrets.USERNAME }}
run: |
poetry run python hello.py
steps:
- uses: actions/checkout@v3
- name: Install poetry
run: pipx install poetry
- uses: actions/setup-python@v4
with:
python-version: '3.9'
cache: 'poetry'
- run: poetry install
- run: poetry run pytest