-
Notifications
You must be signed in to change notification settings - Fork 0
101 lines (81 loc) · 2.82 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
95
96
97
98
99
100
101
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 clingen-stage BigQuery Function Scripts
run: |
echo "Executing BigQuery function scripts for clingen-stage in alphabetical order..."
for file in $(find ./scripts -type f -name '*-func.sql' | sort); do
echo "Executing $file..."
bq query --use_legacy_sql=false --project_id=$PROJECT_ID < "$file"
done
env:
PROJECT_ID: 'clingen-stage'
- name: Execute clingen-dev BigQuery Function Scripts
run: |
echo "Executing BigQuery function scripts for clingen-stage in alphabetical order..."
for file in $(find ./scripts -type f -name '*-func.sql' | sort); do
echo "Executing $file..."
bq query --use_legacy_sql=false --project_id=$PROJECT_ID < "$file"
done
env:
PROJECT_ID: 'clingen-dev'
- name: Execute clingen-dev BigQuery Procedure Scripts
run: |
echo "Executing BigQuery procedure scripts for clingen-stage in alphabetical order..."
for file in $(find ./scripts -type f -name '*-proc.sql' | sort); do
echo "Executing $file..."
bq query --use_legacy_sql=false --project_id=$PROJECT_ID < "$file"
done
env:
PROJECT_ID: 'clingen-dev'