-
Notifications
You must be signed in to change notification settings - Fork 4
73 lines (58 loc) · 2.15 KB
/
Copy pathcheck-ts-types.yml
File metadata and controls
73 lines (58 loc) · 2.15 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
name: Typechecking typescript
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
test_ts-types:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Checkout API repo
uses: actions/checkout@v6
with:
repository: fsek/WebWebWeb
ref: main
path: api-repo
- name: Build & enter DevContainer
uses: devcontainers/ci@v0.3
with:
checkoutPath: api-repo
subFolder: .
runCmd: |
sudo apt-get install -y curl
source .venv/bin/activate
nohup uvicorn main:app --host 0.0.0.0 --port 8000 \
> uvicorn.log 2>&1 & disown
# Wait for the API to be ready
until curl --silent --fail http://localhost:8000/openapi.json; do
sleep 1
done
curl --silent http://localhost:8000/openapi.json \
> openapi.json
- name: Install Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Load cache
uses: actions/cache@v5
with:
# See here for caching with `yarn`, `bun` or other package managers https://github.com/actions/cache/blob/main/examples.md or you can leverage caching with actions/setup-node https://github.com/actions/setup-node
path: |
~/.bun/install/cache
~/.bun/bin
node_modules
${{ github.workspace }}/.next/cache
# Generate a new cache whenever packages or source files change.
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/bun.lock') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }}
# If source files changed but packages didn't, rebuild from a prior cache.
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('**/bun.lock') }}-
- name: Install dependencies (host)
run: bun install --frozen-lockfile
- name: Generate API client
run: bun run generate-api ./api-repo/openapi.json
- name: Check types
run: bun run build