Debian Codegraph @

.github/workflows/ci.yml

raw
1 name: CI
2 on:
3 push:
4 branches:
5 - '**'
6 - '!integrated/**'
7 - '!stl-preview-head/**'
8 - '!stl-preview-base/**'
9 - '!generated'
10 - '!codegen/**'
11 - 'codegen/stl/**'
12 pull_request:
13 branches-ignore:
14 - 'stl-preview-head/**'
15 - 'stl-preview-base/**'
16
17 jobs:
18 build:
19 timeout-minutes: 10
20 name: build
21 permissions:
22 contents: read
23 id-token: write
24 runs-on: ${{ github.repository == 'stainless-sdks/anthropic-go' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
25 if: |-
26 github.repository == 'stainless-sdks/anthropic-go' &&
27 (github.event_name == 'push' || github.event.pull_request.head.repo.fork)
28 steps:
29 - uses: actions/checkout@v6
30
31 - name: Get GitHub OIDC Token
32 if: |-
33 github.repository == 'stainless-sdks/anthropic-go' &&
34 !startsWith(github.ref, 'refs/heads/stl/')
35 id: github-oidc
36 uses: actions/github-script@v8
37 with:
38 script: core.setOutput('github_token', await core.getIDToken());
39
40 - name: Upload tarball
41 if: |-
42 github.repository == 'stainless-sdks/anthropic-go' &&
43 !startsWith(github.ref, 'refs/heads/stl/')
44 env:
45 URL: https://pkg.stainless.com/s
46 AUTH: ${{ steps.github-oidc.outputs.github_token }}
47 SHA: ${{ github.sha }}
48 run: ./scripts/utils/upload-artifact.sh
49 lint:
50 timeout-minutes: 10
51 name: lint
52 runs-on: ${{ github.repository == 'stainless-sdks/anthropic-go' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
53 if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
54
55 steps:
56 - uses: actions/checkout@v6
57
58 - name: Setup go
59 uses: actions/setup-go@v5
60 with:
61 go-version-file: ./go.mod
62
63 - name: Run lints
64 run: ./scripts/lint
65 test:
66 timeout-minutes: 10
67 name: test
68 runs-on: ${{ github.repository == 'stainless-sdks/anthropic-go' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
69 if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
70 steps:
71 - uses: actions/checkout@v6
72
73 - name: Setup go
74 uses: actions/setup-go@v5
75 with:
76 go-version-file: ./go.mod
77
78 - name: Bootstrap
79 run: ./scripts/bootstrap
80
81 - name: Run tests
82 run: ./scripts/test