-
-
Notifications
You must be signed in to change notification settings - Fork 4
53 lines (51 loc) · 1.58 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
53
---
name: Functional Tests
on: # yamllint disable-line rule:truthy
pull_request: {}
push:
branches:
- main
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: deepai
api-key: DEEPAI_API_KEY
threshold: 0.39
- 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: Prepare API key
id: secrets
run: |
if [ "${{ matrix.provider }}" = "sightengine" ]; then
echo "api-key=${{ secrets[matrix.api-user] }},${{ secrets[matrix.api-key] }}" >> $GITHUB_OUTPUT
else
echo "api-key=${{ secrets[matrix.api-key] }}" >> $GITHUB_OUTPUT
fi
- 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: "${{ steps.secrets.outputs.api-key }}"
threshold: "${{ matrix.threshold }}"