-
Notifications
You must be signed in to change notification settings - Fork 0
94 lines (72 loc) · 2.42 KB
/
node.js.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
name: Node.js CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20] # Specify Node.js 20
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: npm install
- name: Compile TypeScript
run: npx tsc
- name: Run tests
run: npm test
deploy:
runs-on: ubuntu-latest
needs: build
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
strategy:
matrix:
node-version: [20] # Specify Node.js 20
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: npm install
- name: Compile TypeScript
run: npx tsc
- name: Authenticate to Google Cloud for clingen-swc
uses: google-github-actions/auth@v1
with:
credentials_json: ${{ secrets.GCP_SA_KEY }}
- name: Setup Google Cloud SDK
uses: google-github-actions/setup-gcloud@v1
with:
version: 'latest'
- name: Copy javascript functions that are referenced by scripts to Google Cloud Storage
run: |
gsutil cp -r ./dist/* gs://clinvar-ingest/bq-tools
- name: Execute BigQuery Script for clingen-stage
env:
PROJECT_ID: 'clingen-stage'
run: |
echo "Executing BigQuery scripts for clingen-stage...(only sql files ending in -func.sql)"
for file in $(find ./scripts -type f -name '*-func.sql'); do
echo "Executing $file..."
bq query --use_legacy_sql=false --project_id=$PROJECT_ID < "$file"
done
- name: Execute BigQuery Script for clingen-dev
env:
PROJECT_ID: 'clingen-dev'
run: |
echo "Executing BigQuery scripts for clingen-dev...(all files ending in -func.sql or -proc.sql)"
for file in $(find ./scripts -type f \( -name '*-func.sql' -o -name '*-proc.sql' \)); do
echo "Executing $file..."
bq query --use_legacy_sql=false --project_id=$PROJECT_ID < "$file"
done