-
Notifications
You must be signed in to change notification settings - Fork 1
83 lines (73 loc) · 2.09 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
75
76
77
78
79
80
81
82
83
name: Test
on:
pull_request: {}
push:
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
test:
strategy:
matrix:
go-version: [1.21.x, 1.22.x]
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
cache: true
cache-dependency-path: go.sum
- name: Test
run: go test ./... -cover
integration-test:
name: Integration test - ${{ matrix.fs }}
strategy:
matrix:
include:
- fs: local
config:
bucket: file://./output/my-bucket
- fs: s3
config:
bucket: s3://my-bucket?endpoint=http://127.0.0.1:9000&disableSSL=true&s3ForcePathStyle=true®ion=us-west-1
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Start MinIO
if: ${{ matrix.fs == 's3' }}
run: >
docker run -d
--name minio
-p 9000:9000
-p 9090:9090
-v $PWD/output:/data
-e "MINIO_REGION_NAME=eu-west-1"
-e "MINIO_ROOT_USER=minioadmin"
-e "MINIO_ROOT_PASSWORD=minioadmin"
quay.io/minio/minio server /data --console-address ":9090"
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: 1.22.x
cache: true
cache-dependency-path: go.sum
- name: Build
run: |
go build
./target-jsonl-blob --version
- name: Write config
run: |
echo '${{ toJSON(matrix.config) }}' > config.json
- run: mkdir output/my-bucket
- name: Test
env:
AWS_ACCESS_KEY_ID: minioadmin
AWS_SECRET_ACCESS_KEY: minioadmin
run: |
./target-jsonl-blob --config config.json --input resources/data/data.jsonl