-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (45 loc) · 1.68 KB
/
test.yml
File metadata and controls
58 lines (45 loc) · 1.68 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
# doi:10.18419/darus-3801
name: Test action
on:
workflow_dispatch:
push:
jobs:
dv-sync:
runs-on: ubuntu-latest
steps:
- name: 'Checkout'
uses: 'actions/checkout@v4'
- name: Run Dataverse Action
id: dataverse
uses: gdcc/dataverse-action@main
- name: 'Install Python'
uses: 'actions/setup-python@v2'
with:
python-version: '3.11'
- name: 'Install requests'
run: |
python3 -m pip install requests
- name: 'Create Dataset'
run: |
export API_TOKEN=${{ steps.dataverse.outputs.api_token }}
export PARENT=root
export SERVER_URL=${{ steps.dataverse.outputs.base_url }}
# Remove the trailing slash from the server URL
SERVER_URL=${SERVER_URL%/}
DATASET_RESPONSE=$(curl -s -H "X-Dataverse-key:$API_TOKEN" -X POST "$SERVER_URL/api/dataverses/$PARENT/datasets" --upload-file .github/workflows/data/initial_dataset.json -H 'Content-type:application/json')
# Print the response
echo $DATASET_RESPONSE
echo "DATASET_PID=$(echo $DATASET_RESPONSE | jq -r '.data.persistentId')" >> $GITHUB_ENV
- name: Synchronize to DV
uses: ./
with:
dataverse_url: ${{ steps.dataverse.outputs.base_url }}
api_token: ${{ steps.dataverse.outputs.api_token }}
persistent_id: ${{ env.DATASET_PID }}
- name: Test content
env:
DV_API_TOKEN: ${{ steps.dataverse.outputs.api_token }}
DV_URL: ${{ steps.dataverse.outputs.base_url }}
DV_PID: ${{ env.DATASET_PID }}
run: |
python3 .github/workflows/scripts/check_content.py