-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (68 loc) · 1.86 KB
/
pr.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
name: optable-pair-cli CI
on:
pull_request:
push:
branches:
- main
env:
GOPATH: ${{ github.workspace }}
jobs:
golangci-lint:
name: GolangCI Lint
runs-on: ubuntu-24.04
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.62.2
pre-commit:
name: Pre-commit
runs-on: ubuntu-24.04
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v3
- name: Setup Pre-commit
run: pip install pre-commit
- name: Install pre-commit
run: pre-commit install
- name: Run all pre-commit hooks
run: SKIP=golangci-lint pre-commit run --all-files
build:
runs-on: ubuntu-24.04
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: '${{ env.GOPATH }}/go.mod'
- name: Install dependencies
run: go get ./...
- name: Build
run: make build
- name: Start fake-gcs-server
run: |
docker run -d --name fake-gcs-server -p 4443:4443 fsouza/fake-gcs-server \
-scheme http \
-public-host 0.0.0.0:4443
- name: Wait for fake-gcs-server to start
run: |
for i in {1..10}; do
if curl -s http://0.0.0.0:4443/storage/v1/; then
echo "fake-gcs-server is ready"
break
fi
echo "Waiting for fake-gcs-server..."
sleep 2
done
- name: Run go tests
env:
STORAGE_EMULATOR_HOST: http://0.0.0.0:4443
run: go test ./...
- name: Cleanup
if: always()
run: docker stop fake-gcs-server && docker rm fake-gcs-server