-
-
Notifications
You must be signed in to change notification settings - Fork 4
52 lines (50 loc) · 1.49 KB
/
functional-tests.yml
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
---
name: Functional Tests
on: # yamllint disable-line rule:truthy
push:
branches:
- "main"
pull_request:
paths:
- ".github/workflows/functional-tests.yml"
- "src/**"
- "!src/__tests__/**"
- "dist/**"
- "action.yml"
schedule:
# Every Friday at 09:00 JST
- cron: "0 0 * * 5"
workflow_dispatch: {}
jobs:
detect:
name: ${{ matrix.provider }}
timeout-minutes: 5
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- provider: cloudmersive
api-key: CLOUDMERSIVE_API_KEY
threshold: 0.32
- provider: picpurify
api-key: PICPURIFY_API_KEY
threshold: 0.97
- provider: sightengine
api-user: SIGHTENGINE_API_USER
api-key: SIGHTENGINE_API_SECRET
threshold: 0.8
steps:
- name: Checkout ${{ github.repository }}
uses: actions/checkout@v4
- name: Download test file
run: |
curl https://images-na.ssl-images-amazon.com/images/I/91cDPlxcRiL._SL1500_.jpg --output test.jpg
git add test.jpg
- name: Detect NSFW content
uses: ./
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
provider: "${{ matrix.provider }}"
api-key: "${{ matrix.provider == 'sightengine' && format('{0},{1}', secrets[matrix.api-user], secrets[matrix.api-key]) || secrets[matrix.api-key] }}"
threshold: "${{ matrix.threshold }}"