-
Notifications
You must be signed in to change notification settings - Fork 0
87 lines (71 loc) · 2.44 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
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
name: CI
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches: [master]
pull_request:
branches: [master]
release:
types: [published]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
Python:
runs-on: windows-latest
steps:
- name: Checkout this Repo
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
id: python-setup
uses: actions/setup-python@v5
with:
python-version: 3.x
- name: Install Workflow Dependencies
run: python3 -m pip install build twine pre-commit -r tests/requirements.txt -r requirements.txt
- uses: actions/cache@v4
with:
path: ~/.cache/pre-commit
key: pre-commit_${{ steps.python-setup.outputs.python-version }}_${{ hashFiles('.pre-commit-config.yaml') }}
- name: Check formatting
run: pre-commit run --all-files
- name: Get test coverage
run: |
coverage run -m pytest
coverage report --format markdown >> $env:GITHUB_STEP_SUMMARY
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: Create Distributions
run: python3 -m build
- name: twine Check
run: twine check dist/*
- name: twine Upload (pypi)
if: github.event_name == 'release'
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.pypi_token }}
run: twine upload dist/*
- name: twine Upload (test-pypi)
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.TEST_PYPI_TOKEN }}
run: twine upload --repository testpypi dist/*
Build:
if: github.event_name == 'push' && github.ref_name == 'master'
runs-on: windows-latest
steps:
- name: Checkout this Repo
uses: actions/checkout@v4
# Runs a this repo's action
- name: Run Build action
id: builder
uses: 2bndy5/rmskin-action@master
with:
path: tests/demo_project
# Use the output from the `builder` step
- name: Print the output filename
run: echo "The output file was ${{ steps.builder.outputs.arc_name }}"