-
Notifications
You must be signed in to change notification settings - Fork 0
108 lines (107 loc) · 3.07 KB
/
files.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
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
name: files
env:
PYPI_API_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
#TWINE_USERNAME: __token__
#TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
on:
push:
paths:
- "**"
- ".github/workflows/files.yml"
defaults:
run:
working-directory: ./
permissions:
id-token: write
contents: write
jobs:
lint:
name: Lint
timeout-minutes: 5
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'pip'
- run: pip install -e .[dev]
- run: python -m ruff .
- run: python -m mypy --strict .
test:
name: Unit tests
timeout-minutes: 5
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: configure aws credentials
uses: aws-actions/configure-aws-credentials@v3
with:
role-to-assume: arn:aws:iam::654654529166:role/numerous-files-test
role-session-name: GitHub_to_AWS_via_FederatedOIDC
aws-region: eu-north-1
- name: Debug Session Info
run: aws sts get-caller-identity
- name: run tests
uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'pip'
- run: pip install -e .[dev]
- run: coverage run -m pytest -vv tests/
env:
NUMEROUS_FILES_AWS_ACCESS_KEY: ${{ secrets.AWS_ACCESS_KEY_ID }}
NUMEROUS_FILES_AWS_SECRET_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- run: coverage report | grep 'TOTAL' | awk '{print "COVERAGE_PCT=" $4}' >> $GITHUB_ENV
# TODO: publish coverage report
build:
timeout-minutes: 15
runs-on: ubuntu-latest
name: Build package
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: "pip"
- uses: actions/setup-go@v5
with:
cache: false
- run: python3 -m pip install python-semantic-release==9.6.0 build>=1.2.1
- run: semantic-release version --no-commit --no-tag --no-push --no-changelog # update version locally to build new version
- run: python -m build
- uses: actions/upload-artifact@v4
with:
name: package
path: ./dist/*
release:
if: github.ref == 'refs/heads/main'
timeout-minutes: 15
runs-on: ubuntu-latest
name: Release
environment: release
needs:
- lint
- test
- build
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: "pip"
- uses: actions/download-artifact@v4
id: download
with:
name: package
path: ./dist
- run: pip install python-semantic-release==9.6.0
- run: semantic-release version --commit --tag --push
- run: semantic-release publish
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1