Skip to content

Commit 28c1679

Browse files
authored
ci: improvements
* fix: type errors * ci: improves * ci: fix test * ci: test simple * ci: workflow_run fix?
1 parent c222b8b commit 28c1679

11 files changed

Lines changed: 24 additions & 70 deletions

File tree

.github/workflows/check-dist.yml

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,10 @@
88
name: check dist
99

1010
on:
11-
push:
12-
branches:
13-
- main
14-
paths-ignore:
15-
- '**.md'
16-
pull_request:
17-
branches:
18-
- main
19-
paths-ignore:
20-
- '**.md'
11+
workflow_run:
12+
workflows: ['test']
13+
types:
14+
- completed
2115
workflow_dispatch:
2216

2317
concurrency:
@@ -26,6 +20,7 @@ concurrency:
2620

2721
jobs:
2822
check-dist:
23+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
2924
runs-on: ubuntu-latest
3025
timeout-minutes: 5
3126
steps:

.github/workflows/deploy.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,10 @@
22

33
name: deploy
44
on:
5-
pull_request:
6-
branches:
7-
- main
8-
push:
9-
branches:
10-
- main
5+
workflow_run:
6+
workflows: ['test', 'check dist']
7+
types:
8+
- completed
119
workflow_dispatch:
1210
inputs:
1311
environment:
@@ -20,6 +18,7 @@ concurrency:
2018

2119
jobs:
2220
cloudflare-pages-deploy:
21+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
2322
permissions:
2423
actions: read
2524
contents: read

.github/workflows/release.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,9 @@ name: release
44

55
on:
66
workflow_run:
7-
workflows:
8-
- test
9-
branches:
10-
- main
11-
types:
12-
- completed
7+
workflows: [test, check dist]
8+
branches: [main]
9+
types: [completed]
1310

1411
concurrency: ${{ github.workflow }}-${{ github.ref }}
1512

.github/workflows/test.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,7 @@ jobs:
2525
node-version: 20
2626
- name: Lint
2727
run: pnpm run lint
28+
- name: Typecheck
29+
run: pnpm run tsc:check
2830
- name: Test
2931
run: pnpm run test:ci

.github/workflows/typecheck.yml

Lines changed: 0 additions & 27 deletions
This file was deleted.

__mocks__/wrangler.ts

Lines changed: 0 additions & 12 deletions
This file was deleted.

__tests__/common/batch-delete.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import * as core from '@actions/core'
22
import {afterEach, beforeEach, describe, expect, test, vi} from 'vitest'
33

44
import {DeploymentState, DeploymentStatusState} from '@/gql/graphql.js'
5-
import RESPONSE_CLOUDFLARE_DEPLOYMENT_DELETE from '@/responses/api.cloudflare.com/pages/deployments/deployments-delete.response.json'
5+
import RESPONSE_CLOUDFLARE_DEPLOYMENT_DELETE from '@/responses/api.cloudflare.com/pages/deployments/deployments-delete.response.json' with {type: 'json'}
66

77
import {batchDelete} from '@/common/batch-delete.js'
88
import {getCloudflareLogEndpoint} from '@/common/cloudflare/api/endpoints.js'

__tests__/common/cloudflare/api/fetch-result.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ import {afterEach, beforeEach, describe, expect, test, vi} from 'vitest'
33

44
import type {MockApi} from '@/tests/helpers/api.js'
55

6-
import RESPONSE_NOT_FOUND from '@/responses/api.cloudflare.com/pages/projects/project-not-found.response.json'
7-
import RESPONSE_OK from '@/responses/api.cloudflare.com/pages/projects/project.response.json'
8-
import RESPONSE_UNAUTHORIZED from '@/responses/api.cloudflare.com/unauthorized.response.json'
6+
import RESPONSE_NOT_FOUND from '@/responses/api.cloudflare.com/pages/projects/project-not-found.response.json' with {type: 'json'}
7+
import RESPONSE_OK from '@/responses/api.cloudflare.com/pages/projects/project.response.json' with {type: 'json'}
8+
import RESPONSE_UNAUTHORIZED from '@/responses/api.cloudflare.com/unauthorized.response.json' with {type: 'json'}
99
import {getMockApi} from '@/tests/helpers/api.js'
1010

1111
import {fetchResult} from '@/common/cloudflare/api/fetch-result.js'

__tests__/common/cloudflare/deployment/create.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ import {afterEach, beforeEach, describe, expect, test, vi} from 'vitest'
33

44
import type {MockApi} from '@/tests/helpers/api.js'
55

6-
import RESPONSE_NOT_FOUND_DEPLOYMENTS from '@/responses/api.cloudflare.com/pages/deployments/deployments-not-found.response.json'
7-
import RESPONSE_DEPLOYMENTS_IDLE from '@/responses/api.cloudflare.com/pages/deployments/deployments.idle.response.json'
8-
import RESPONSE_DEPLOYMENTS from '@/responses/api.cloudflare.com/pages/deployments/deployments.response.json'
6+
import RESPONSE_NOT_FOUND_DEPLOYMENTS from '@/responses/api.cloudflare.com/pages/deployments/deployments-not-found.response.json' with {type: 'json'}
7+
import RESPONSE_DEPLOYMENTS_IDLE from '@/responses/api.cloudflare.com/pages/deployments/deployments.idle.response.json' with {type: 'json'}
8+
import RESPONSE_DEPLOYMENTS from '@/responses/api.cloudflare.com/pages/deployments/deployments.response.json' with {type: 'json'}
99
import {MOCK_API_PATH_DEPLOYMENTS, setMockApi} from '@/tests/helpers/api.js'
1010
import {stubInputEnv} from '@/tests/helpers/inputs.js'
1111

__tests__/common/github/comment.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import {afterEach, beforeEach, describe, expect, test, vi} from 'vitest'
22

33
import type {MockApi} from '@/tests/helpers/api.js'
44

5-
import RESPONSE_DEPLOYMENTS from '@/responses/api.cloudflare.com/pages/deployments/deployments.response.json'
5+
import RESPONSE_DEPLOYMENTS from '@/responses/api.cloudflare.com/pages/deployments/deployments.response.json' with {type: 'json'}
66
import {setMockApi} from '@/tests/helpers/api.js'
77
import {EVENT_NAMES} from '@/types/github/workflow-events.js'
88

0 commit comments

Comments
 (0)