forked from subquery/cosmos-subql-starter
-
Notifications
You must be signed in to change notification settings - Fork 10
74 lines (56 loc) · 1.88 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: End-to-end tests
on:
pull_request:
branches: [main]
jobs:
e2e-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.GH_ACCESS_TOKEN }}
- name: Update
run: sudo apt update
- name: Install OS dependencies
run: sudo apt install -y python3-dev nodejs
- name: Install NodeJS dependencies
run: yarn install
- name: Lint TypeScript
run: yarn lint
- name: Codegen TypeScript
run: yarn codegen
- name: Build TypeScript
run: yarn build
- name: Run TypeScript unit tests
run: yarn test
# Authenticate to GCP
- id: 'auth'
uses: 'google-github-actions/auth@v0'
with:
credentials_json: '${{ secrets.DEVOPS_IMAGES_SA_KEY }}'
- name: 'Set up Cloud SDK'
uses: 'google-github-actions/setup-gcloud@v0'
- run: 'gcloud info'
# Configure docker to use the gcloud command-line tool as a credential helper
- name: Configure Docker
run: |
gcloud auth configure-docker -q
- name: Start-up local test environment
uses: isbang/[email protected]
with:
compose-file: "./ci-compose.yml"
# NB: doing this after start-up gives the test env time to come up
- name: Install Python dependencies
uses: palewire/install-python-pipenv-pipfile@v2
with:
python-version: 3.9
- name: Allow 45s for environment to configure properly
uses: jakejarvis/wait-action@master
with:
time: '45s'
- name: Run Python unit tests
run: pipenv run python -m unittest discover -s ./tests/unit
- name: Run end-to-end tests
env:
GITHUB_AUTHORIZATION_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }}
run: pipenv run python -m unittest discover -s ./tests/e2e