Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.

Commit ca0977b

Browse files
committed
ci(template-workflow): 👷 add github workflow
1 parent fd5821f commit ca0977b

2 files changed

Lines changed: 78 additions & 0 deletions

File tree

.github/workflow/ci.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: ci
2+
3+
on:
4+
push:
5+
pull_request:
6+
branches:
7+
- main
8+
- dev
9+
10+
defaults:
11+
run:
12+
shell: bash
13+
14+
permissions:
15+
contents: write
16+
17+
jobs:
18+
tests:
19+
strategy:
20+
max-parallel: 4
21+
matrix:
22+
os:
23+
- ubuntu-latest
24+
- macos-latest
25+
python-version:
26+
- "3.9"
27+
- "3.10"
28+
- "3.11"
29+
copier-version:
30+
- "8.1.0"
31+
runs-on: ${{ matrix.os }}
32+
33+
steps:
34+
- uses: actions/checkout@v3
35+
- name: Set up PDM
36+
uses: pdm-project/setup-pdm@main
37+
with:
38+
python-version: ${{ matrix.python-version }}
39+
- name: Set variables
40+
id: set_variables
41+
run: |
42+
git config --global user.name "GitHub Action"
43+
git config --global user.email "[email protected]"
44+
git config --global init.defaultBranch main
45+
46+
- name: Install dependencies
47+
run: python -m pip install -U copier
48+
49+
- name: Setup tests (Unix)
50+
run: bash tests/setup.sh
51+
if: runner.os != 'Windows'
52+
53+
- name: Run tests
54+
run: bash tests/test_generate.sh
55+
working-directory: ${{ github.workspace }}/tests/tmp

.github/workflow/release.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: release
2+
3+
on: push
4+
5+
jobs:
6+
release:
7+
runs-on: ubuntu-latest
8+
if: startsWith(github.ref, 'refs/tags/')
9+
steps:
10+
- name: Checkout
11+
uses: actions/checkout@v3
12+
- name: Fetch all tags
13+
run: git fetch --depth=1 --tags
14+
- name: Setup Python
15+
uses: actions/setup-python@v4
16+
- name: Install git-changelog
17+
run: pip install git-changelog
18+
- name: Prepare release notes
19+
run: git-changelog --release-notes > release-notes.md
20+
- name: Create release
21+
uses: softprops/action-gh-release@v1
22+
with:
23+
body_path: release-notes.md

0 commit comments

Comments
 (0)