Skip to content

Commit def06b9

Browse files
authored
Merge pull request #159 from tigrisdata/Xe/TIG-3547
Run tests on all languages with examples on commit/PR to main
2 parents 3e6e9ab + a10fa4c commit def06b9

File tree

4 files changed

+178
-0
lines changed

4 files changed

+178
-0
lines changed
Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
name: Language-specific validation
2+
on:
3+
pull_request:
4+
branches: ["main"]
5+
push:
6+
branches: ["main"]
7+
8+
jobs:
9+
dotnet:
10+
name: ".Net"
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
- uses: actions/setup-dotnet@v4
15+
with:
16+
dotnet-version: "9.0.x"
17+
cache: true
18+
cache-dependency-path: "**/package-lock.json"
19+
- run:
20+
curl -s
21+
https://raw.githubusercontent.com/dotnet-script/dotnet-script/master/install/install.sh
22+
| sudo bash
23+
- run: |
24+
cd examples/dotnet
25+
dotnet restore
26+
- run: |
27+
cd examples/dotnet
28+
dotnet run # runs GettingStarted.cs
29+
dotnet script ListBuckets.csx
30+
dotnet script PutObject.csx
31+
env:
32+
AWS_ACCESS_KEY_ID: ${{ secrets.LANG_AWS_ACCESS_KEY_ID }}
33+
AWS_SECRET_ACCESS_KEY: ${{ secrets.LANG_AWS_SECRET_ACCESS_KEY }}
34+
AWS_REGION: auto
35+
go:
36+
name: Go
37+
runs-on: ubuntu-latest
38+
steps:
39+
- uses: actions/checkout@v4
40+
- uses: actions/setup-go@v5
41+
with:
42+
cache-dependency-path: |
43+
examples/go/go.sum
44+
- name: Deps
45+
run: |
46+
cd examples/go
47+
go mod download
48+
- name: Examples
49+
run: |
50+
cd examples/go
51+
go run ./cmd/getting-started tigris-example
52+
go run ./cmd/conditional-operations tigris-example
53+
go run ./cmd/metadata-querying tigris-example
54+
go run ./cmd/object-regions tigris-example
55+
go run ./cmd/presigned-urls tigris-example
56+
env:
57+
AWS_ACCESS_KEY_ID: ${{ secrets.LANG_AWS_ACCESS_KEY_ID }}
58+
AWS_SECRET_ACCESS_KEY: ${{ secrets.LANG_AWS_SECRET_ACCESS_KEY }}
59+
AWS_REGION: auto
60+
javascript:
61+
name: "JavaScript"
62+
runs-on: ubuntu-latest
63+
steps:
64+
- uses: actions/checkout@v4
65+
- uses: actions/setup-node@v4
66+
with:
67+
node-version: "latest"
68+
- name: Deps
69+
run: |
70+
cd examples/js
71+
npm ci --include=dev
72+
- name: Examples
73+
run: |
74+
cd examples/js
75+
node getting-started.js
76+
node presigned-urls.js
77+
env:
78+
AWS_ACCESS_KEY_ID: ${{ secrets.LANG_AWS_ACCESS_KEY_ID }}
79+
AWS_SECRET_ACCESS_KEY: ${{ secrets.LANG_AWS_SECRET_ACCESS_KEY }}
80+
AWS_REGION: auto
81+
AWS_ENDPOINT_URL_S3: https://fly.storage.tigris.dev
82+
python:
83+
name: "Python"
84+
runs-on: ubuntu-latest
85+
steps:
86+
- uses: actions/checkout@v4
87+
- uses: actions/setup-python@v5
88+
with:
89+
python-version: "3.11"
90+
cache: pip
91+
- run: |
92+
cd examples/python
93+
pip install -r requirements.txt
94+
- run: |
95+
cd examples/python
96+
python getting-started.py
97+
python hardcode-credentials.py
98+
python object-metadata.py
99+
python object-regions.py
100+
env:
101+
AWS_ACCESS_KEY_ID: ${{ secrets.LANG_AWS_ACCESS_KEY_ID }}
102+
AWS_SECRET_ACCESS_KEY: ${{ secrets.LANG_AWS_SECRET_ACCESS_KEY }}
103+
AWS_REGION: auto
104+
ruby:
105+
name: "Ruby"
106+
runs-on: ubuntu-latest
107+
steps:
108+
- uses: actions/checkout@v4
109+
- uses: ruby/setup-ruby@v1
110+
with:
111+
ruby-version: "3.4"
112+
- run: |
113+
cd examples/ruby
114+
bundle install
115+
- run: |
116+
cd examples/ruby
117+
ruby getting_started.rb
118+
env:
119+
AWS_ACCESS_KEY_ID: ${{ secrets.LANG_AWS_ACCESS_KEY_ID }}
120+
AWS_SECRET_ACCESS_KEY: ${{ secrets.LANG_AWS_SECRET_ACCESS_KEY }}
121+
AWS_REGION: auto

examples/dotnet/dotnet.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
<TargetFramework>net9.0</TargetFramework>
66
<ImplicitUsings>enable</ImplicitUsings>
77
<Nullable>enable</Nullable>
8+
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
89
</PropertyGroup>
910

1011
<ItemGroup>

examples/dotnet/packages.lock.json

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
{
2+
"version": 1,
3+
"dependencies": {
4+
"net9.0": {
5+
"AWSSDK.S3": {
6+
"type": "Direct",
7+
"requested": "[3.7.414.1, )",
8+
"resolved": "3.7.414.1",
9+
"contentHash": "MJMLuPxbf5CBK8hcMxW9vC9jgzCQnhdND9g2MfYN308Vagf0XPej39G/W+ffqC5/eYmAUEv9Wj4P5LkqNPBErg==",
10+
"dependencies": {
11+
"AWSSDK.Core": "[3.7.401.11, 4.0.0)"
12+
}
13+
},
14+
"AWSSDK.SecurityToken": {
15+
"type": "Direct",
16+
"requested": "[3.7.401.40, )",
17+
"resolved": "3.7.401.40",
18+
"contentHash": "5sPVE9eWiwFKqCWGz6wqVdhf7FDsyN570nhFfMhhPSvQ1C/r8PlSJIFoVzMtYKfeTf/4pR3YC4w9IRi8+tAJzA==",
19+
"dependencies": {
20+
"AWSSDK.Core": "[3.7.401.11, 4.0.0)"
21+
}
22+
},
23+
"AWSSDK.SSO": {
24+
"type": "Direct",
25+
"requested": "[3.7.400.91, )",
26+
"resolved": "3.7.400.91",
27+
"contentHash": "G7Zyy4C9aDVmqUgi12h00g3vexOgRyKNPeLb7VO8+sloz3zdiEnDEWsa98bvCfnODCDJbXjfD/XcQIshTZQ7gg==",
28+
"dependencies": {
29+
"AWSSDK.Core": "[3.7.401.11, 4.0.0)"
30+
}
31+
},
32+
"AWSSDK.SSOOIDC": {
33+
"type": "Direct",
34+
"requested": "[3.7.400.92, )",
35+
"resolved": "3.7.400.92",
36+
"contentHash": "GWyHDjnvzC3n63N+clJ37Z5VCYw60u1wenBPCVGsrxBD4CZE0+rO/nhHCDYJw4vyeAM3cqBKjZc4LwsV07hFpQ==",
37+
"dependencies": {
38+
"AWSSDK.Core": "[3.7.401.11, 4.0.0)"
39+
}
40+
},
41+
"AWSSDK.Core": {
42+
"type": "Transitive",
43+
"resolved": "3.7.401.11",
44+
"contentHash": "tZ8dXsHj/6JaheljHB/2+AVXUwfq5Wij0h9odQclABdtM78CfdKs0f8xTQ6fS3UttSVgc5bmKTqNvEaocNOLeg=="
45+
}
46+
}
47+
}
48+
}

examples/python/requirements.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
-i https://pypi.org/simple
2+
boto3==1.36.12; python_version >= '3.8'
3+
botocore==1.36.12; python_version >= '3.8'
4+
jmespath==1.0.1; python_version >= '3.7'
5+
python-dateutil==2.9.0.post0; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2'
6+
s3transfer==0.11.2; python_version >= '3.8'
7+
six==1.17.0; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2'
8+
urllib3==2.3.0; python_version >= '3.9'

0 commit comments

Comments
 (0)