Skip to content

Commit 16282fd

Browse files
committed
trying for fix ci
1 parent f4ab216 commit 16282fd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+2863
-58
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ jobs:
1212
- uses: actions/checkout@v4
1313
- name: Install uv
1414
uses: astral-sh/setup-uv@v3
15+
- name: Install just
16+
uses: extractions/setup-just@v2
17+
- name: Install deps
18+
run: just bootstrap
1519
- name: Run tests
16-
run: uv sync && uvx pytest
20+
run: just test
1721

dotfm/.dockerignore

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
*
2+
3+
!dotfm/
4+
!deploy/
5+
!manage.py
6+
!requirements*.txt
7+
!tailwind.config.js
8+
!package*.json
9+
10+
**/*~
11+
**/*.log
12+
**/.DS_Store
13+
**/Thumbs.db
14+
**/__pycache__/

dotfm/.editorconfig

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# http://editorconfig.org
2+
3+
root = true
4+
5+
[*]
6+
charset = utf-8
7+
end_of_line = lf
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[*.{py,rst,ini}]
12+
indent_style = space
13+
indent_size = 4
14+
15+
[*.{html,css,scss,json,yml,xml,toml}]
16+
indent_style = space
17+
indent_size = 2
18+
19+
[*.md]
20+
trim_trailing_whitespace = false
21+
22+
[Makefile]
23+
indent_style = tab
24+
25+
[default.conf]
26+
indent_style = space
27+
indent_size = 2

dotfm/.env.template

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
SECRET_KEY=
2+
ALLOWED_HOSTS=
3+
DEBUG=
4+
DATABASE_URL=
5+
ADMIN_URL=
6+
DEFAULT_FROM_EMAIL=
7+
8+
AWS_ACCESS_KEY_ID=
9+
AWS_SECRET_ACCESS_KEY=
10+
AWS_S3_REGION_NAME=
11+
12+
SENTRY_DSN=
13+
14+
DJANGO_SUPERUSER_EMAIL=
15+
DJANGO_SUPERUSER_PASSWORD=
16+
DJANGO_SUPERUSER_USERNAME=

dotfm/.github/dependabot.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5+
6+
version: 2
7+
updates:
8+
- package-ecosystem: "pip" # See documentation for possible values
9+
directory: "/" # Location of package manifests
10+
schedule:
11+
interval: "weekly"
12+
13+
- package-ecosystem: "pip"
14+
directory: "/requirements"
15+
schedule:
16+
interval: "weekly"

dotfm/.github/workflows/cd.yml

Lines changed: 174 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,174 @@
1+
name: CD
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*.*.*"
7+
8+
jobs:
9+
deploy-to-caprover:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: read
13+
packages: write
14+
steps:
15+
- uses: adamghill/build-docker-and-deploy-to-caprover@main
16+
with:
17+
github-token: ${{ secrets.GITHUB_TOKEN }}
18+
caprover-app-name: "dotfm"
19+
caprover-server-url: ${{ secrets.CAPROVER_SERVER_URL }}
20+
caprover-app-token: ${{ secrets.CAPROVER_APP_TOKEN }}
21+
docker-file-name: deploy/Dockerfile
22+
23+
build-python-wheel-and-sdist:
24+
name: Build a pure Python wheel and source distribution
25+
runs-on: ubuntu-latest
26+
steps:
27+
- name: Checkout code
28+
uses: actions/checkout@v4
29+
30+
- name: Install Hatch
31+
uses: pypa/hatch@install
32+
33+
- name: Install just
34+
uses: extractions/setup-just@v2
35+
36+
- name: Build
37+
run: just build-wheel
38+
39+
- uses: actions/upload-artifact@v4
40+
with:
41+
name: wheels
42+
path: dist/*
43+
if-no-files-found: error
44+
overwrite: true
45+
46+
build-binaries:
47+
name: Build binary application for ${{ matrix.job.target }} (${{ matrix.job.os }})
48+
runs-on: ${{ matrix.job.os }}
49+
needs: build-python-wheel-and-sdist
50+
strategy:
51+
fail-fast: false
52+
matrix:
53+
job:
54+
# Linux
55+
- target: x86_64-unknown-linux-gnu
56+
os: ubuntu-latest
57+
cross: true
58+
release_suffix: x86_64-linux
59+
# - target: x86_64-unknown-linux-musl
60+
# os: ubuntu-latest
61+
# cross: true
62+
- target: aarch64-unknown-linux-gnu
63+
os: ubuntu-latest
64+
cross: true
65+
release_suffix: aarch64-linux
66+
# - target: i686-unknown-linux-gnu
67+
# os: ubuntu-latest
68+
# cross: true
69+
# release_suffix: i686-linux
70+
# Windows
71+
# - target: x86_64-pc-windows-msvc
72+
# os: windows-2022
73+
# release_suffix: x86_64-windows
74+
# - target: i686-pc-windows-msvc
75+
# os: windows-2022
76+
# release_suffix: i686-windows
77+
# macOS
78+
# - target: aarch64-apple-darwin
79+
# os: macos-12
80+
# release_suffix: aarch64-osx
81+
# - target: x86_64-apple-darwin
82+
# os: macos-12
83+
# release_suffix: x86_64-osx
84+
85+
env:
86+
CARGO_BUILD_TARGET: ${{ matrix.job.target }}
87+
88+
steps:
89+
- name: Install Hatch
90+
uses: pypa/hatch@install
91+
92+
- name: Install just
93+
uses: extractions/setup-just@v2
94+
95+
- name: Code Checkout
96+
uses: actions/checkout@v4
97+
98+
- name: Install musl-tools on Linux
99+
run: sudo apt-get install --yes musl musl-dev musl-tools
100+
if: ${{ matrix.job.os == 'ubuntu-latest' }}
101+
102+
- name: Install Rust toolchain
103+
if: ${{ !matrix.job.cross }}
104+
uses: dtolnay/rust-toolchain@stable
105+
with:
106+
targets: ${{ matrix.job.target }}
107+
108+
- name: Set up cross compiling tools
109+
if: matrix.job.cross
110+
uses: taiki-e/setup-cross-toolchain-action@v1
111+
with:
112+
target: ${{ matrix.job.target}}
113+
114+
- name: Show toolchain information
115+
run: |-
116+
rustup toolchain list
117+
rustup default
118+
rustup -V
119+
rustc -V
120+
cargo -V
121+
hatch --version
122+
123+
- uses: actions/download-artifact@v4
124+
with:
125+
name: wheels
126+
path: ${{ github.workspace }}/dist
127+
merge-multiple: true
128+
129+
- name: Build binary
130+
run: just build-bin
131+
132+
- name: Rename
133+
working-directory: ${{ github.workspace }}
134+
run: |-
135+
mv dist/binary/dotfm* dist/binary/dotfm-${{ matrix.job.release_suffix }}
136+
137+
- name: Upload built binary package
138+
uses: actions/upload-artifact@v4
139+
with:
140+
name: binaries-${{ matrix.job.release_suffix }}
141+
path: dist/binary/*
142+
if-no-files-found: error
143+
144+
release:
145+
name: Create a GitHub release
146+
runs-on: ubuntu-latest
147+
permissions:
148+
contents: write
149+
needs: [build-python-wheel-and-sdist, build-binaries]
150+
steps:
151+
- name: Checkout code
152+
uses: actions/checkout@v4
153+
154+
- name: Install Hatch
155+
uses: pypa/hatch@install
156+
157+
- name: Install just
158+
uses: extractions/setup-just@v2
159+
160+
- uses: actions/download-artifact@v4
161+
with:
162+
path: dist
163+
merge-multiple: true
164+
165+
- name: Generate Changelog
166+
run: |
167+
awk '/^## /{if (p) exit; p=1; next} p' ${{ github.workspace }}/CHANGELOG.md | tee ${{ github.workspace }}-CHANGELOG.txt
168+
169+
- name: Release
170+
uses: softprops/action-gh-release@v2
171+
with:
172+
body_path: ${{ github.workspace }}-CHANGELOG.txt
173+
files: dist/*
174+
fail_on_unmatched_files: true

dotfm/.github/workflows/ci.yml

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
branches: ["master", "main"]
6+
paths-ignore: ["docs/**"]
7+
8+
push:
9+
branches: ["master", "main"]
10+
paths-ignore: ["docs/**"]
11+
12+
workflow_dispatch:
13+
14+
concurrency:
15+
group: ${{ github.head_ref || github.run_id }}
16+
cancel-in-progress: true
17+
18+
jobs:
19+
types:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- name: Checkout Code Repository
23+
uses: actions/checkout@v4
24+
25+
- name: Set up Python
26+
uses: actions/setup-python@v5
27+
with:
28+
python-version: '3.12'
29+
30+
- name: Install Hatch
31+
uses: pypa/hatch@install
32+
33+
- name: Install just
34+
uses: extractions/setup-just@v2
35+
36+
- name: Run type checking
37+
run: just types
38+
39+
checks:
40+
runs-on: ubuntu-latest
41+
steps:
42+
- name: Checkout Code Repository
43+
uses: actions/checkout@v4
44+
45+
- name: Set up Python
46+
uses: actions/setup-python@v5
47+
with:
48+
python-version: '3.12'
49+
50+
- name: Install Hatch
51+
uses: pypa/hatch@install
52+
53+
- name: Install just
54+
uses: extractions/setup-just@v2
55+
56+
- name: Run deployment checks
57+
run: just deploy-checks
58+
59+
test:
60+
runs-on: ubuntu-latest
61+
steps:
62+
- name: Checkout Code Repository
63+
uses: actions/checkout@v4
64+
65+
- name: Set up Python
66+
uses: actions/setup-python@v5
67+
with:
68+
python-version: '3.12'
69+
70+
- name: Install Hatch
71+
uses: pypa/hatch@install
72+
73+
- name: Install just
74+
uses: extractions/setup-just@v2
75+
76+
- name: Build staticfiles
77+
run: just collectstatic
78+
- name: Test with pytest
79+
run: just test

0 commit comments

Comments
 (0)