Skip to content

Commit 095977e

Browse files
committed
add workflows
1 parent ace0940 commit 095977e

File tree

3 files changed

+110
-0
lines changed

3 files changed

+110
-0
lines changed

.github/workflows/build.yml

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Build Extension
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches: [ "main" ]
7+
pull_request:
8+
branches: [ "main" ]
9+
10+
jobs:
11+
build:
12+
runs-on: macos-14
13+
strategy:
14+
matrix:
15+
version: [4.2, 4.3]
16+
env:
17+
ADDON_NAME: csv_importer
18+
steps:
19+
- uses: actions/checkout@v3
20+
- uses: SebRollen/toml-action@v1.2.0
21+
id: read_manifest
22+
with:
23+
file: '${{ env.ADDON_NAME }}/blender_manifest.toml'
24+
field: 'version'
25+
- uses: BradyAJohnston/setup-blender@v2
26+
with:
27+
version: ${{ matrix.version }}
28+
- name: Build extension
29+
run: |
30+
blender -b -P build.py
31+
mkdir artifact
32+
mv ${{ env.ADDON_NAME }}-${{ steps.read_manifest.outputs.value }}-*.zip ./artifact/.
33+
- name: Archive addon
34+
uses: actions/upload-artifact@v4
35+
with:
36+
name: ${{ env.ADDON_NAME }}-build_${{ matrix.version }}-${{ github.sha }}
37+
retention-days: 3
38+
path: |
39+
./artifact/*

.github/workflows/release.yml

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Create Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
build-and-release:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
- uses: BradyAJohnston/setup-blender@v3
17+
with:
18+
version: 4.2
19+
- name: Install uv
20+
uses: astral-sh/setup-uv@v4
21+
with:
22+
version: "latest"
23+
- name: Build Extension
24+
run: |
25+
blender -b -P build.py
26+
27+
- name: Create Release
28+
run: |
29+
# Create release with auto-generated notes
30+
gh release create ${{ github.ref_name }} --generate-notes *.zip
31+
env:
32+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/tests.yml

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Run Tests
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
pull_request:
7+
branches: ["*"]
8+
9+
jobs:
10+
build:
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
max-parallel: 4
14+
fail-fast: false
15+
matrix:
16+
version: ["4.2.5", "4.3.2", "daily"]
17+
os: [macos-14, windows-latest, ubuntu-latest]
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- uses: BradyAJohnston/setup-blender@v2.1
22+
with:
23+
version: ${{ matrix.version }}
24+
- name: Install in Blender
25+
run: blender -b -P tests/python.py -- -m pip install ".[test]"
26+
- name: Run Tests in Blender
27+
run: blender -b -P tests/run.py -- -vv tests --cov --cov-report=xml
28+
29+
- name: Upload coverage to Codecov
30+
uses: codecov/codecov-action@v5
31+
with:
32+
token: ${{ secrets.CODECOV_TOKEN }}
33+
34+
- name: Upload test results to Codecov
35+
if: ${{ !cancelled() }}
36+
uses: codecov/test-results-action@v1
37+
with:
38+
token: ${{ secrets.CODECOV_TOKEN }}
39+

0 commit comments

Comments
 (0)