-
Notifications
You must be signed in to change notification settings - Fork 31
139 lines (124 loc) · 4.42 KB
/
run_e2e_on_ref_local.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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
name: "Run E2E tests on ref (local)"
on:
workflow_dispatch:
inputs:
# We are using PR number here instead of SHA or branch name to make it possible to run this on PRs from forks
pr:
type: string
required: true
description: "Pull request number/url"
sha:
type: string
required: true
description: "Latest PR commit hash"
# ^ To validate that PR has not changed before the checkout
jobs:
run_e2e:
name: "Build and run E2E"
runs-on: ubuntu-latest
permissions:
contents: read
packages: read
container:
image: "ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}/debian_docker:latest"
options: -v /var/run/docker.sock:/var/run/docker.sock
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: 'Cleanup build folder'
run: |
rm -rf ./* || true
rm -rf ./.??* || true
- name: dircheck_initial
run: |
pwd
ls -la
ls -la ../
ls -la /__w || true
ls -la /__w/datalens-backend || true
ls -la /__w/datalens-backend/datalens-backend || true
ls -la /__w/datalens-backend/datalens-backend/datalens-backend || true
- name: Checkout datalens-ui repo
run: git clone https://github.com/datalens-tech/datalens-ui.git /__w/datalens-backend/datalens-backend/datalens-ui
# uses: actions/checkout@v4
# with:
# repository: datalens-tech/datalens-ui
# path: /__w/datalens-backend/datalens-backend/datalens-ui
# path: tools/e2e/datalens-ui
# - name: Fix dubious ownership
# run: .github/.scripts/git_config_save_directory.sh
# env:
# REPOSITORY_NAME: datalens-ui
- name: dircheck
run: |
ls -la
ls -la ../
ls -la /__w || true
ls -la /__w/datalens-backend || true
ls -la /__w/datalens-backend/datalens-backend || true
- name: Checkout code
run: git clone https://github.com/datalens-tech/datalens-backend.git /__w/datalens-backend/datalens-backend/datalens-backend
# uses: actions/checkout@v2
# with:
# path: /__w/datalens-backend/datalens-backend/datalens-backend
- name: dircheck
run: |
ls -la
ls -la ../
ls -la /__w || true
ls -la /__w/datalens-backend || true
ls -la /__w/datalens-backend/datalens-backend || true
# - name: Fix dubious ownership
# working-directory: datalens-backend
# run: .github/.scripts/git_config_save_directory.sh
# env:
# REPOSITORY_NAME: ${{ github.event.repository.name }}
- name: Switch to PR head
working-directory: /__w/datalens-backend/datalens-backend/datalens-backend
run: gh pr checkout ${{ github.event.inputs.pr }}
env:
GH_TOKEN: ${{ github.token }}
- name: Validate SHA
working-directory: /__w/datalens-backend/datalens-backend/datalens-backend
run: |
export HEAD_SHA=$(git rev-parse HEAD)
export INPUT_SHA="${{ github.event.inputs.sha }}"
echo "Calculated latest commit in PR: $HEAD_SHA"
if [ x"$HEAD_SHA" != x"$INPUT_SHA" ]; then
echo "The branch was updated since the workflow was triggered, exiting"
exit 1
fi
- name: Install Task
uses: arduino/setup-task@v1
with:
version: 3.33.1
# - name: Checkout datalens-ui repo
# uses: actions/checkout@v4
# with:
# repository: datalens-tech/datalens-ui
# path: tools/e2e/datalens-ui
- name: dircheck
run: |
ls -la
ls -la ../
ls -la /__w || true
ls -la /__w/datalens-backend || true
- uses: actions/setup-node@v3
with:
node-version: 18
cache: 'npm'
# cache-dependency-path: ../datalens-ui/package-lock.json
cache-dependency-path: /__w/datalens-backend/datalens-backend/datalens-ui/package-lock.json
- name: dircheck
working-directory: datalens-backend
run: |
ls -la
ls -la ../
ls -la /__w || true
ls -la /__w/datalens-backend || true
ls -la /__w/datalens-backend/datalens-backend || true
ls -la /__w/datalens-backend/datalens-backend/datalens-ui || true
- name: Build and run E2E
working-directory: /__w/datalens-backend/datalens-backend/datalens-backend
run: task e2e:init-and-run DATALENS_UI_FOLDER="../../../datalens-ui"