Skip to content

Commit 296fe51

Browse files
authored
Use main CI workflow for merge queue (#790)
1 parent 779d378 commit 296fe51

File tree

2 files changed

+40
-66
lines changed

2 files changed

+40
-66
lines changed

.github/workflows/ci.yml

+40-22
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ on:
77
pull_request:
88
branches:
99
- main
10+
merge_group:
11+
branches:
12+
- main
1013

1114
permissions:
1215
contents: read
@@ -47,48 +50,54 @@ jobs:
4750
strategy:
4851
fail-fast: false
4952
matrix:
50-
include:
53+
config:
5154
- os: ubuntu-latest
5255
coverage: true
5356
- os: windows-latest
5457
coverage: true
58+
skip: ${{ github.event_name == 'merge_group' }}
5559
- os: macos-latest
5660
coverage: true
61+
skip: ${{ github.event_name == 'merge_group' }}
5762
- os: ubuntu-latest
5863
name: 'no submodules'
5964
no-submodules: true
6065
- os: ['self-hosted', '1ES.Pool=TypeScript-1ES-GitHub-XL', '1ES.ImageOverride=mariner-2.0']
6166
name: 'race mode'
6267
race: true
68+
skip: ${{ github.event_name == 'merge_group' }}
6369
- os: ubuntu-latest
6470
name: 'noembed'
6571
noembed: true
6672
- os: ubuntu-latest
6773
name: 'concurrent test programs'
6874
concurrent-test-programs: true
6975
coverage: true
76+
exclude:
77+
- config:
78+
skip: true
7079

71-
name: test (${{ matrix.name || matrix.os }})
80+
name: test (${{ matrix.config.name || matrix.config.os }})
7281

73-
runs-on: ${{ matrix.os }}
82+
runs-on: ${{ matrix.config.os }}
7483

7584
permissions:
7685
id-token: write
7786
contents: read
7887

7988
env:
80-
TSGO_HEREBY_RACE: ${{ (matrix.race && 'true') || 'false' }}
81-
TSGO_HEREBY_NOEMBED: ${{ (matrix.noembed && 'true') || 'false' }}
82-
TSGO_HEREBY_CONCURRENT_TEST_PROGRAMS: ${{ (matrix.concurrent-test-programs && 'true') || 'false' }}
83-
TSGO_HEREBY_COVERAGE: ${{ (matrix.coverage && 'true') || 'false' }}
89+
TSGO_HEREBY_RACE: ${{ (matrix.config.race && 'true') || 'false' }}
90+
TSGO_HEREBY_NOEMBED: ${{ (matrix.config.noembed && 'true') || 'false' }}
91+
TSGO_HEREBY_CONCURRENT_TEST_PROGRAMS: ${{ (matrix.config.concurrent-test-programs && 'true') || 'false' }}
92+
TSGO_HEREBY_COVERAGE: ${{ (matrix.config.coverage && 'true') || 'false' }}
8493

8594
steps:
8695
- run: git config --system core.longpaths true
87-
if: ${{ matrix.os == 'windows-latest' }}
96+
if: ${{ matrix.config.os == 'windows-latest' }}
8897

8998
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
9099
with:
91-
submodules: ${{ !matrix.no-submodules }}
100+
submodules: ${{ !matrix.config.no-submodules }}
92101
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
93102
with:
94103
node-version: 'lts/*'
@@ -102,7 +111,7 @@ jobs:
102111
- run: go install gotest.tools/gotestsum@latest
103112
# Installing gotestsum is super slow on Windows.
104113
# Also, avoid using it in race mode so we get the full output.
105-
if: ${{ matrix.os != 'windows-latest' && !matrix.race }}
114+
if: ${{ matrix.config.os != 'windows-latest' && !matrix.config.race }}
106115

107116
- name: Tests
108117
id: test
@@ -120,10 +129,10 @@ jobs:
120129
- run: git add .
121130

122131
- uses: codecov/codecov-action@0565863a31f2c772f9f0395002a31e3f06189574 # v5.4.0
123-
if: ${{ always() && matrix.coverage }}
132+
if: ${{ always() && matrix.config.coverage && github.event_name != 'merge_group' }}
124133
with:
125134
use_oidc: true
126-
name: ${{ matrix.name || matrix.os }}
135+
name: ${{ matrix.config.name || matrix.config.os }}
127136
directory: ./coverage
128137

129138
- run: git diff --staged --exit-code --stat
@@ -137,35 +146,41 @@ jobs:
137146
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
138147
if: ${{ failure() && steps.test.conclusion == 'failure' }}
139148
with:
140-
name: ${{ matrix.os }}-${{ (matrix.race && 'race') || 'norace' }}-new-baselines-artifact
149+
name: ${{ matrix.config.os }}-${{ (matrix.config.race && 'race') || 'norace' }}-new-baselines-artifact
141150
path: testdata/baselines/local
142151

143152
lint:
144153
strategy:
145154
fail-fast: false
146155
matrix:
147-
include:
156+
config:
148157
- os: ubuntu-latest
149158
- os: windows-latest
159+
skip: ${{ github.event_name == 'merge_group' }}
150160
- os: macos-latest
161+
skip: ${{ github.event_name == 'merge_group' }}
151162
- os: ubuntu-latest
152163
name: 'noembed'
153164
noembed: true
165+
skip: ${{ github.event_name == 'merge_group' }}
166+
exclude:
167+
- config:
168+
skip: true
154169

155-
name: lint (${{ matrix.name || matrix.os }})
170+
name: lint (${{ matrix.config.name || matrix.config.os }})
156171

157-
runs-on: ${{ matrix.os }}
172+
runs-on: ${{ matrix.config.os }}
158173

159174
env:
160-
TSGO_HEREBY_NOEMBED: ${{ (matrix.noembed && 'true') || 'false' }}
175+
TSGO_HEREBY_NOEMBED: ${{ (matrix.config.noembed && 'true') || 'false' }}
161176

162177
steps:
163178
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
164179
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
165180
- uses: dtolnay/rust-toolchain@fcf085fcb4b4b8f63f96906cd713eb52181b5ea4 # stable
166181
- uses: ./.github/actions/setup-go
167182
with:
168-
cache-name: lint${{ (matrix.noembed && '-noembed') || ''}}
183+
cache-name: lint${{ (matrix.config.noembed && '-noembed') || ''}}
169184

170185
- run: npm ci
171186

@@ -308,17 +323,20 @@ jobs:
308323
runs-on: ubuntu-latest
309324
if: ${{ always() }}
310325
needs:
326+
- baselines
311327
- build
312-
- test
313-
- lint
328+
- extension
314329
- format
315330
- generate
316-
- tidy
331+
- lint
332+
- misc
317333
- smoke
334+
- test
335+
- tidy
318336

319337
steps:
320338
- name: Check required jobs
321339
env:
322340
NEEDS: ${{ toJson(needs) }}
323341
run: |
324-
! echo $NEEDS | jq -e 'to_entries[] | { job: .key, result: .value.result } | select(.result != "success")'
342+
! echo $NEEDS | jq -e 'to_entries[] | { job: .key, result: .value.result } | select((.result == "success" or .result == "skipped") | not)'

.github/workflows/merge-queue.yml

-44
This file was deleted.

0 commit comments

Comments
 (0)