-
Notifications
You must be signed in to change notification settings - Fork 3
57 lines (57 loc) · 2.13 KB
/
test.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
54
55
56
57
name: Import GSheets into Dolt
on:
workflow_dispatch:
env:
id: '1ulqohI6YLYFsz3wm8f5j6BS_JVelu2Ea8SXXa-wwkhQ'
remote: 'fedderw/polls'
branch: 'main'
jobs:
plugin_tests:
runs-on: ubuntu-latest
name: Test Plugin
steps:
- name: Step 1 - Download Agent Data
id: 'sheet_to_csv'
uses: dolthub/[email protected]
with:
creds: ${{ secrets.GOOGLE_CREDENTIAL }}
tempdir: ${{ github.workspace }} #/github/workspace
sheets: |
[
{ "id": "${{ env.id }}", "title": "Response Favorability"},
{ "id": "${{ env.id }}", "title": "Pollsters"},
{ "id": "${{ env.id }}", "title": "Questions"},
{ "id": "${{ env.id }}", "title": "Polls"},
{ "id": "${{ env.id }}", "title": "Regions"},
{ "id": "${{ env.id }}", "title": "Responses"}
]
- name: Step 2 - Dolt Import
uses: dolthub/[email protected]
id: 'dolt_import'
env:
FILES: ${{ steps.sheet_to_csv.outputs.results }}
with:
before: |
file_list=($FILES)
head "${file_list[1]}"
dolt table import --update-table response_favorability "${file_list[1]}"
dolt table import --update-table pollsters "${file_list[2]}"
dolt table import --update-table questions "${file_list[3]}"
dolt table import --update-table polls "${file_list[4]}"
dolt table import --update-table regions "${file_list[5]}"
dolt table import --update-table responses "${file_list[6]}"
remote: ${{ env.remote }}
branch: ${{ env.branch }}
commit_message: 'Dolt action commit'
dolthub_credential: ${{ secrets.DOLTHUB_CREDENTIAL }}
push: true
- name: Step 3 - Table Diff
uses: dolthub/[email protected]
id: 'training_diff'
if: steps.dolt_import.outputs.commit != ''
with:
remote: ${{ env.remote }}
branch: ${{ env.branch }}
dolthub_credential: ${{ secrets.DOLTHUB_CREDENTIAL }}
before: |
dolt diff HEAD^ HEAD