-
Notifications
You must be signed in to change notification settings - Fork 7
80 lines (66 loc) · 2.35 KB
/
Copy pathtest-sdk.yml
File metadata and controls
80 lines (66 loc) · 2.35 KB
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
name: Test SDK
on:
pull_request:
branches: [ main ]
types: [opened, synchronize, reopened, ready_for_review]
paths:
- 'src/**'
- 'scripts/**'
- 'ci/**'
- 'openapi/**'
- 'vitest.config.ts'
- 'tsconfig*.json'
- 'package.json'
- 'pnpm-lock.yaml'
- 'pnpm-workspace.yaml'
- '.github/workflows/test-sdk.yml'
permissions:
contents: read
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Set up pnpm
uses: pnpm/action-setup@v6
- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version: '24'
cache: 'pnpm'
- name: Install Docker Compose
run: |
sudo apt-get update && sudo apt-get install -y docker-compose
- name: Restore Docker Image Cache
id: restore-cache
uses: actions/cache@v6
with:
path: /tmp/docker-image-cache
key: ${{ runner.os }}-docker-${{ hashFiles('**/ci/docker-compose.yml') }}
- name: Load Cached Docker Images
if: steps.restore-cache.outputs.cache-hit == 'true'
run: |
echo "Loading cached Docker images..."
for tar in /tmp/docker-image-cache/*.tar; do
echo "Loading $tar"
docker load -i "$tar"
done
- name: Install Dependencies
run: pnpm install --frozen-lockfile
- name: Type-check Integration Tests
run: pnpm exec tsc -p src/integration-tests/tsconfig.json --noEmit
- name: Pull Docker Images
run: docker-compose -f ci/docker-compose.yml pull
- name: Save Docker Images to Cache
run: |
mkdir -p /tmp/docker-image-cache
echo "Saving Docker images to cache..."
# List images related to your project; adjust the grep pattern as needed.
docker images --format '{{.Repository}}:{{.Tag}}' | grep "eclipsebasyx" > /tmp/docker-image-cache/images.txt
while IFS= read -r img; do
tarname=$(echo $img | tr '/:' '_').tar
echo "Saving image $img to /tmp/docker-image-cache/$tarname"
docker save "$img" -o /tmp/docker-image-cache/"$tarname"
done < /tmp/docker-image-cache/images.txt
- name: Run Tests
run: pnpm test