forked from duneanalytics/spellbook
-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (47 loc) · 1.83 KB
/
commit_manifest.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
58
59
name: Commit Manifest
on:
workflow_dispatch:
push:
branches:
- "main"
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true
jobs:
commit_manifest:
runs-on: [ self-hosted, linux, spellbook-trino-ci ]
strategy:
matrix:
project: [ 'tokens', 'spellbook', 'daily_spellbook', 'nft', 'dex']
max-parallel: 1
steps:
- uses: actions/setup-python@v3
- name: Checkout main branch
uses: actions/checkout@v2
with:
ref: main
- name: Add git_sha to schema
run: "/runner/change_schema.sh wizard"
- name: Setup variables
run: |
echo "GIT_SHA=$(echo ${{ github.sha }} | tr - _ | cut -c1-7)" >> $GITHUB_ENV
echo "PROFILE=--profiles-dir $HOME/.dbt --profile dunesql" >> $GITHUB_ENV
echo "S3_LOCATION=s3://manifest-spellbook-dunesql/${{matrix.project}}" >> $GITHUB_ENV
PROJECT_DIR=${{ matrix.project }}
if [[ "$PROJECT_DIR" == "spellbook" ]]; then
PROJECT_DIR="."
fi
echo "PROJECT_DIR=$PROJECT_DIR" >> $GITHUB_ENV
- name: dbt dependencies
working-directory: ${{env.PROJECT_DIR}}
run: "dbt deps"
- name: Run dbt debug on Trino if dunesql engine is used, and retry until cluster is available
run: "./scripts/ensure_cluster.sh"
- name: dbt compile to create prod manifest from main
run: "dbt compile --target-path . $PROFILE --project-dir ${PROJECT_DIR}"
- name: copy old manifest locally
run: "aws s3 cp $S3_LOCATION/manifest.json $S3_LOCATION/previous_manifest.json"
- name: upload git_sha versioned previous manifest (for manual catchup if jobs fail)
run: "aws s3 cp $S3_LOCATION/manifest.json $S3_LOCATION/manifest_$GIT_SHA.json"
- name: upload manifest
run: "aws s3 cp $PROJECT_DIR/manifest.json $S3_LOCATION/manifest.json"