Skip to content

Commit f441475

Browse files
dsschultgithub-actions
andauthored
CI setup (#1)
* first commit * add version * <bot> update setup.cfg * <bot> update README.md * <bot> add py.typed file(s) * <bot> update .gitignore * <bot> update dependencies*.log files(s) * <bot> update dependencies*.log files(s) * <bot> update dependencies*.log files(s) * try fixing infinte CI loop * <bot> update dependencies*.log files(s) * try fixing infinte CI loop (try 2) * set name * <bot> update setup.cfg * <bot> update dependencies*.log files(s) * <bot> update dependencies*.log files(s) * try other tag for setup action * <bot> update setup.cfg * <bot> update dependencies*.log files(s) * update py-setup --------- Co-authored-by: github-actions <github-actions@github.com>
1 parent 7125e88 commit f441475

File tree

10 files changed

+206
-0
lines changed

10 files changed

+206
-0
lines changed

.github/workflows/docker.yaml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: docker releases
2+
3+
on:
4+
push:
5+
branches-ignore:
6+
- '**'
7+
tags:
8+
- '**'
9+
workflow_dispatch:
10+
11+
jobs:
12+
docker:
13+
name: "Docker Image"
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout Project
17+
uses: actions/checkout@v3
18+
- name: Docker meta
19+
id: docker_meta
20+
uses: docker/metadata-action@v3
21+
with:
22+
images: |
23+
ghcr.io/WIPACRepo/cephfs-disk-usage
24+
tags: |
25+
type=ref,event=branch
26+
type=semver,pattern={{major}}
27+
type=semver,pattern={{major}}.{{minor}}
28+
type=semver,pattern={{major}}.{{minor}}.{{patch}}
29+
- name: Login to GitHub Container Registry
30+
uses: docker/login-action@v1
31+
if: ${{ github.event_name != 'pull_request' }}
32+
with:
33+
registry: ghcr.io
34+
username: ${{ github.actor }}
35+
password: ${{ secrets.GITHUB_TOKEN }}
36+
- name: Push Docker Image
37+
uses: docker/build-push-action@v2
38+
with:
39+
context: .
40+
push: ${{ github.event_name != 'pull_request' }}
41+
tags: ${{ steps.docker_meta.outputs.tags }}
42+
labels: ${{ steps.docker_meta.outputs.labels }}

.github/workflows/wipac-cicd.yml

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
name: wipac ci/cd
2+
3+
on:
4+
push:
5+
branches:
6+
- '**'
7+
tags-ignore:
8+
- '**'
9+
10+
env:
11+
py_version: '3.10'
12+
13+
jobs:
14+
15+
flake8:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v3
19+
- uses: actions/setup-python@v4
20+
with:
21+
python-version: ${{ env.py_version }}
22+
- uses: WIPACrepo/wipac-dev-flake8-action@v1.0
23+
24+
py-setup:
25+
runs-on: ubuntu-latest
26+
steps:
27+
- name: checkout
28+
uses: actions/checkout@v3
29+
with:
30+
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
31+
- uses: WIPACrepo/wipac-dev-py-setup-action@v2.5
32+
33+
py-versions:
34+
runs-on: ubuntu-latest
35+
outputs:
36+
matrix: ${{ steps.versions.outputs.matrix }}
37+
steps:
38+
- uses: actions/checkout@v3
39+
- id: versions
40+
uses: WIPACrepo/wipac-dev-py-versions-action@v2.1
41+
42+
pip-install:
43+
needs: [py-versions]
44+
runs-on: ubuntu-latest
45+
strategy:
46+
max-parallel: 4
47+
fail-fast: false
48+
matrix:
49+
version: ${{ fromJSON(needs.py-versions.outputs.matrix) }}
50+
steps:
51+
- uses: actions/checkout@v3
52+
- uses: actions/setup-python@v4
53+
with:
54+
python-version: ${{ matrix.version }}
55+
- run: |
56+
pip install --upgrade pip wheel setuptools
57+
pip install .
58+
59+
docker-build:
60+
name: "Docker Image"
61+
runs-on: ubuntu-latest
62+
steps:
63+
- name: Checkout Project
64+
uses: actions/checkout@v3
65+
- name: Build Docker Image
66+
uses: docker/build-push-action@v4
67+
with:
68+
context: .
69+
push: false
70+
71+
release:
72+
if: ${{ github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' }}
73+
needs: [flake8, py-setup, pip-install, docker-build]
74+
runs-on: ubuntu-latest
75+
concurrency: release
76+
steps:
77+
- uses: actions/checkout@v3
78+
with:
79+
fetch-depth: 0
80+
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
81+
- name: Python Semantic Release
82+
uses: relekang/python-semantic-release@v7.34.6
83+
with:
84+
github_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
85+
#repository_username: __token__
86+
#repository_password: ${{ secrets.PYPI_TOKEN }}

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,3 +158,7 @@ cython_debug/
158158
# and can be added to the global gitignore or merged into this file. For a more nuclear
159159
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
160160
#.idea/
161+
162+
163+
# wipac-dev-py-setup-action
164+
!dependencies*.log

Dockerfile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM python:3.10
2+
3+
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y attr
4+
5+
RUN groupadd -g 1000 app && useradd -m -g 1000 -u 1000 app
6+
7+
WORKDIR /home/app
8+
9+
COPY --chown=1000:1000 . cephfs-disk-usage
10+
11+
RUN pip install --no-cache-dir -e cephfs-disk-usage
12+
13+
CMD ["python", "-m", "cephfs_disk_usage"]

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
1+
<!--- Top of README Badges (automated) --->
2+
[![GitHub release (latest by date including pre-releases)](https://img.shields.io/github/v/release/WIPACrepo/cephfs-disk-usage?include_prereleases)](https://github.com/WIPACrepo/cephfs-disk-usage/) [![Lines of code](https://img.shields.io/tokei/lines/github/WIPACrepo/cephfs-disk-usage)](https://github.com/WIPACrepo/cephfs-disk-usage/) [![GitHub issues](https://img.shields.io/github/issues/WIPACrepo/cephfs-disk-usage)](https://github.com/WIPACrepo/cephfs-disk-usage/issues?q=is%3Aissue+sort%3Aupdated-desc+is%3Aopen) [![GitHub pull requests](https://img.shields.io/github/issues-pr/WIPACrepo/cephfs-disk-usage)](https://github.com/WIPACrepo/cephfs-disk-usage/pulls?q=is%3Apr+sort%3Aupdated-desc+is%3Aopen)
3+
<!--- End of README Badges (automated) --->
14
# cephfs-disk-usage
25
CephFS disk usage website

cephfs_disk_usage/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__version__ = '0.0.0'

cephfs_disk_usage/py.typed

Whitespace-only changes.

dependencies-from-Dockerfile.log

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
cachetools==5.3.1
2+
certifi==2023.7.22
3+
cffi==1.15.1
4+
charset-normalizer==3.2.0
5+
cryptography==41.0.3
6+
idna==3.4
7+
pycparser==2.21
8+
PyJWT==2.8.0
9+
pypng==0.20220715.0
10+
qrcode==7.4.2
11+
requests==2.31.0
12+
requests-futures==1.0.1
13+
tornado==6.3.3
14+
typing_extensions==4.7.1
15+
urllib3==2.0.4
16+
wipac-dev-tools==1.6.16
17+
wipac-rest-tools==1.5.2

setup.cfg

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
[wipac:cicd_setup_builder]
2+
python_min = 3.10
3+
4+
[metadata] # generated by wipac:cicd_setup_builder: name, version
5+
name = cephfs_disk_usage
6+
version = attr: cephfs_disk_usage.__version__
7+
8+
[semantic_release] # fully-generated by wipac:cicd_setup_builder
9+
version_variable = cephfs_disk_usage/__init__.py:__version__
10+
upload_to_pypi = False
11+
patch_without_tag = True
12+
commit_parser = semantic_release.history.emoji_parser
13+
major_emoji = [major]
14+
minor_emoji = [minor]
15+
patch_emoji = [fix], [patch]
16+
branch = main
17+
18+
[options] # generated by wipac:cicd_setup_builder: python_requires, packages
19+
install_requires =
20+
wipac-rest-tools
21+
python_requires = >=3.10, <3.12
22+
packages = find:
23+
24+
[options.package_data] # generated by wipac:cicd_setup_builder: '*'
25+
* = py.typed
26+
27+
[options.packages.find] # generated by wipac:cicd_setup_builder: include/exclude
28+
exclude =
29+
test
30+
tests
31+
doc
32+
docs
33+
resource
34+
resources
35+
example
36+
examples
37+

setup.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env python3
2+
from setuptools import setup
3+
setup()

0 commit comments

Comments
 (0)