-
-
Notifications
You must be signed in to change notification settings - Fork 38
135 lines (108 loc) · 3.28 KB
/
event-dispatch.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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
name: Event dispatch
on:
workflow_dispatch:
inputs:
commit-id:
description: Commit ID of withastro/astro
required: true
type: string
repository_dispatch:
types: [astro-push-main-event]
permissions:
actions: write
contents: write
pull-requests: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
synchronize:
runs-on: ubuntu-latest
steps:
- name: Get commit ID (workflow dispatch, empty)
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.commit-id == '' }}
run: echo "You must provide a full commit ID." && exit 1
- name: Get commit ID (workflow dispatch, non-empty)
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.commit-id != '' }}
run: echo "COMMIT_ID=${{ github.event.inputs.commit-id }}" >> $GITHUB_ENV
- name: Get commit ID (repository dispatch)
if: ${{ github.event_name == 'repository_dispatch'}}
run: echo "COMMIT_ID=${{ github.event.client_payload.event.head_commit.id }}" >> "$GITHUB_ENV"
- name: Get short commit ID
run: echo "SHORT_COMMIT_ID=$(echo ${{ env.COMMIT_ID }} | cut -c 1-7)" >> "$GITHUB_ENV"
test_cloudflare:
runs-on: ubuntu-latest
needs: synchronize
steps:
- name: Disable git crlf
run: git config --global core.autocrlf false
- name: Checkout
uses: actions/checkout@v4
- name: Setup PNPM
uses: pnpm/action-setup@v3
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: "pnpm"
- name: Checkout Astro repository
uses: actions/checkout@v4
with:
repository: withastro/astro
ref: ${{ env.COMMIT_ID }}
path: astro
- name: Compile and link Astro
working-directory: astro
run: |
pnpm install
pnpm run build
- name: Install dependencies
run: |
pnpm install
- name: Build
working-directory: packages/cloudflare
run: |
pnpm link ../../astro/packages/astro
pnpm run build
continue-on-error: true
- name: Test
run: |
pnpm run test
test_netlify:
runs-on: ubuntu-latest
needs: synchronize
steps:
- name: Disable git crlf
run: git config --global core.autocrlf false
- name: Checkout
uses: actions/checkout@v4
- name: Setup PNPM
uses: pnpm/action-setup@v3
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: "pnpm"
- name: Checkout Astro repository
uses: actions/checkout@v4
with:
repository: withastro/astro
ref: ${{ env.COMMIT_ID }}
path: astro
- name: Compile and link Astro
working-directory: astro
run: |
pnpm install
pnpm run build
- name: Install dependencies
run: |
pnpm install
- name: Build
working-directory: packages/netlify
run: |
pnpm link ../../astro/packages/astro
pnpm run build
continue-on-error: true
- name: Test
run: |
pnpm run test