-
-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (64 loc) · 1.51 KB
/
ci.yaml
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
name: CI
on:
push:
tags:
- "**"
pull_request:
concurrency:
group: ci-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Hatch
uses: pypa/hatch@install
- name: Run Lint
run: |
hatch fmt --check
build:
runs-on: ubuntu-latest
needs: lint
steps:
- uses: actions/checkout@v4
- name: Install Hatch
uses: pypa/hatch@install
- name: Run Build
run: |
hatch env create
hatch build
test:
runs-on: ubuntu-latest
needs: lint
steps:
- uses: actions/checkout@v4
- name: Install Hatch
uses: pypa/hatch@install
- name: Run Test
env:
FYMAIL_GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
hatch env create test
hatch env show
hatch run pip list
hatch run pip install pytest-asyncio
hatch run pip list
hatch -e fymail-test test
publish:
runs-on: ubuntu-latest
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/')
needs:
- build
- test
steps:
- uses: actions/checkout@v4
- name: Install Hatch
uses: pypa/hatch@install
- name: publish
env:
HATCH_INDEX_USER: __token__
HATCH_INDEX_AUTH: ${{ secrets.PYPI_API_TOKEN }}
run: |
hatch build
hatch publish