-
-
Notifications
You must be signed in to change notification settings - Fork 1
112 lines (98 loc) · 3.42 KB
/
action-test.yml
File metadata and controls
112 lines (98 loc) · 3.42 KB
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
109
110
111
112
name: Test Action
on:
push:
paths:
- 'action.yml'
- 'scripts/**'
- '.github/workflows/action-test.yml'
pull_request:
paths:
- 'action.yml'
- 'scripts/**'
- '.github/workflows/action-test.yml'
workflow_dispatch:
jobs:
test-action:
name: Test Birda Action
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install ffmpeg
run: sudo apt-get update && sudo apt-get install -y ffmpeg
- name: Download BirdNET model
run: |
mkdir -p models
echo "Downloading BirdNET v2.4 model..."
curl -fsSL -o models/birdnet-v24.onnx \
"https://huggingface.co/justinchuby/BirdNET-onnx/resolve/main/birdnet.onnx"
echo "Downloading labels..."
curl -fsSL -o models/labels.txt \
"https://github.com/tphakala/birda/raw/main/data/labels/birdnet_v2.4/BirdNET_GLOBAL_6K_V2.4_Labels_en_uk.txt"
ls -la models/
- name: Create test audio
run: |
# Create a 3-second test audio file at 48kHz (BirdNET sample rate)
mkdir -p tests/fixtures
ffmpeg -f lavfi -i "sine=frequency=3000:duration=3" -ar 48000 tests/fixtures/test.wav
ls -la tests/fixtures/
- name: Run action (local reference)
id: birda
uses: ./
with:
model: models/birdnet-v24.onnx
model-type: birdnet-v24
audio: tests/fixtures/test.wav
output: test-results.csv
confidence: 0.01
labels: models/labels.txt
- name: Verify output exists
run: |
if [[ ! -f "${{ steps.birda.outputs.results }}" ]]; then
echo "::error::Output file not found"
exit 1
fi
echo "=== Output file contents ==="
cat "${{ steps.birda.outputs.results }}"
- name: Upload results
uses: actions/upload-artifact@v4
with:
name: test-results
path: test-results.csv
test-nested-output:
name: Test Nested Output Directory
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install ffmpeg
run: sudo apt-get update && sudo apt-get install -y ffmpeg
- name: Download BirdNET model
run: |
mkdir -p models
curl -fsSL -o models/birdnet-v24.onnx \
"https://huggingface.co/justinchuby/BirdNET-onnx/resolve/main/birdnet.onnx"
curl -fsSL -o models/labels.txt \
"https://github.com/tphakala/birda/raw/main/data/labels/birdnet_v2.4/BirdNET_GLOBAL_6K_V2.4_Labels_en_uk.txt"
- name: Create test audio
run: |
mkdir -p tests/fixtures
ffmpeg -f lavfi -i "sine=frequency=3000:duration=3" -ar 48000 tests/fixtures/test.wav
- name: Run action with nested output path
id: birda
uses: ./
with:
model: models/birdnet-v24.onnx
model-type: birdnet-v24
audio: tests/fixtures/test.wav
output: results/subdir/predictions.csv
confidence: 0.01
labels: models/labels.txt
- name: Verify nested output exists
run: |
if [[ ! -f "results/subdir/predictions.csv" ]]; then
echo "::error::Nested output file not found"
exit 1
fi
echo "Nested output directory handling works correctly"
cat results/subdir/predictions.csv