Skip to content

Commit 3e5ed1d

Browse files
authored
Merge pull request #20989 from emberjs/kg-ci-refactor-for-oidc
2 parents 8b61091 + 1c56cfb commit 3e5ed1d

File tree

4 files changed

+264
-285
lines changed

4 files changed

+264
-285
lines changed

.github/workflows/alpha-releases.yml

Lines changed: 10 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -6,32 +6,21 @@ on:
66
workflow_dispatch:
77

88
jobs:
9-
test:
10-
name: Basic Test
11-
runs-on: ubuntu-latest
12-
steps:
13-
- uses: actions/checkout@v4
14-
- uses: ./.github/actions/setup
15-
- name: build
16-
run: pnpm vite build --mode=development
17-
- name: test
18-
run: pnpm test
9+
tests:
10+
uses: ./.github/workflows/ci-jobs.yml
1911

2012
release:
2113
permissions:
22-
contents: write # to push tag
23-
id-token: write
14+
contents: read # PAT used for push
2415

25-
name: Tag + Release
16+
name: Tag + Push
2617
runs-on: ubuntu-latest
27-
needs: [test]
18+
needs: [ tests ]
2819
steps:
2920
- uses: actions/checkout@v4
30-
- uses: ./.github/actions/setup
3121
with:
32-
node-version: '20'
33-
- name: Update npm
34-
run: npm install -g npm@latest # npm >= 11.5.1 is needed
22+
persist-credentials: false
23+
- uses: ./.github/actions/setup
3524
- name: setup git
3625
run: |
3726
git config --local user.email '[email protected]'
@@ -44,33 +33,7 @@ jobs:
4433
- name: bump version
4534
run: npm version ${{env.NEXT_ALPHA}} --allow-same-version --no-git-tag-version
4635
- name: create tag
47-
run: git tag v${{env.NEXT_ALPHA}}-ember-source
48-
- name: build for publish
49-
env:
50-
BUILD_TYPE: alpha
51-
OVERRIDE_FEATURES: ''
52-
run: node bin/build-for-publishing.js
53-
- name: publish to npm
54-
run: npm publish
36+
run: git tag v${{env.NEXT_ALPHA}}-ember-source
5537
- name: push tag
56-
# Push in a way that will NOT trigger other workflows
57-
run: git push origin v${{env.NEXT_ALPHA}}-ember-source
58-
59-
notify:
60-
name: Notify Discord
61-
runs-on: ubuntu-latest
62-
needs:
63-
[
64-
test,
65-
release,
66-
]
67-
if: failure()
68-
steps:
69-
- uses: sarisia/actions-status-discord@v1
70-
with:
71-
webhook: ${{ secrets.FRAMEWORK_WEBHOOK }}
72-
status: 'Failure'
73-
title: 'Ember.js Alpha Release'
74-
color: 0xcc0000
75-
url: '${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}'
76-
username: GitHub Actions
38+
# Push in a way that WILL trigger other workflows
39+
run: git push https://${GITHUB_ACTOR}:${{ secrets.PERSONAL_TOKEN }}@github.com/${GITHUB_REPOSITORY} v${{env.NEXT_ALPHA}}-ember-source

.github/workflows/ci-jobs.yml

Lines changed: 186 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,186 @@
1+
name: Reusable CI Jobs
2+
3+
on:
4+
workflow_call:
5+
6+
permissions:
7+
contents: read
8+
9+
jobs:
10+
lint:
11+
name: Linting
12+
runs-on: ubuntu-latest
13+
outputs:
14+
matrix: ${{ steps.set-matrix.outputs.matrix }}
15+
steps:
16+
- uses: actions/checkout@v4
17+
- uses: ./.github/actions/setup
18+
- name: linting
19+
run: pnpm lint
20+
- id: set-matrix
21+
working-directory: smoke-tests/scenarios
22+
run: |
23+
matrix_json=$(pnpm scenario-tester list --require @swc-node/register --files "*-test.ts" --matrix "pnpm run test --filter %s" )
24+
echo "matrix=$matrix_json" >> $GITHUB_OUTPUT
25+
26+
types:
27+
name: Type Checking (current version)
28+
runs-on: ubuntu-latest
29+
steps:
30+
- uses: actions/checkout@v4
31+
- uses: ./.github/actions/setup
32+
- name: build types
33+
run: pnpm build:types
34+
- name: Check published and internal types
35+
run: pnpm type-check
36+
37+
types-range:
38+
name: Type Checking (other supported versions)
39+
runs-on: ubuntu-latest
40+
needs: [ 'types' ]
41+
strategy:
42+
matrix:
43+
ts-version: [ '5.2', '5.3', '5.4', '5.5', '5.6', '5.7', '5.8', '5.9' ]
44+
steps:
45+
- uses: actions/checkout@v4
46+
- uses: ./.github/actions/setup
47+
- name: build stable type definitions
48+
run: pnpm build:types
49+
- name: install TS@${{matrix.ts-version}}
50+
run: pnpm add --save-dev --workspace-root typescript@${{ matrix.ts-version }}
51+
- name: Check published and internal types with TS@${{matrix.ts-version}}
52+
run: pnpm type-check
53+
54+
basic-test:
55+
name: Basic Test
56+
runs-on: ubuntu-latest
57+
steps:
58+
- uses: actions/checkout@v4
59+
- uses: ./.github/actions/setup
60+
- name: build
61+
run: pnpm vite build --mode=development
62+
- name: test
63+
run: pnpm test
64+
65+
variant-tests:
66+
name: ${{ matrix.name }}
67+
runs-on: ubuntu-latest
68+
needs: [ basic-test, lint, types ]
69+
strategy:
70+
matrix:
71+
include:
72+
- name: "All deprecations enabled"
73+
ALL_DEPRECATIONS_ENABLED: "true"
74+
- name: "All deprecations enabled, with optional features"
75+
ALL_DEPRECATIONS_ENABLED: "true"
76+
ENABLE_OPTIONAL_FEATURES: "true"
77+
- name: "Deprecations as errors"
78+
OVERRIDE_DEPRECATION_VERSION: "15.0.0"
79+
- name: "Deprecations as errors, with optional features"
80+
OVERRIDE_DEPRECATION_VERSION: "15.0.0"
81+
ENABLE_OPTIONAL_FEATURES: "true"
82+
- name: "Production build"
83+
BUILD: "production"
84+
- name: "Production build, with optional features"
85+
BUILD: "production"
86+
ENABLE_OPTIONAL_FEATURES: "true"
87+
88+
steps:
89+
- uses: actions/checkout@v4
90+
- uses: ./.github/actions/setup
91+
- name: build
92+
run: pnpm vite build --mode=${{ matrix.BUILD || 'development' }}
93+
- name: test
94+
env:
95+
ALL_DEPRECATIONS_ENABLED: ${{ matrix.ALL_DEPRECATIONS_ENABLED }}
96+
OVERRIDE_DEPRECATION_VERSION: ${{ matrix.OVERRIDE_DEPRECATION_VERSION }}
97+
ENABLE_OPTIONAL_FEATURES: ${{ matrix.ENABLE_OPTIONAL_FEATURES }}
98+
RAISE_ON_DEPRECATION: ${{ matrix.RAISE_ON_DEPRECATION }}
99+
100+
run: pnpm test
101+
102+
browserstack-test:
103+
name: Browserstack Tests (Safari, Edge)
104+
runs-on: ubuntu-latest
105+
needs: [ basic-test, lint, types ]
106+
steps:
107+
- uses: actions/checkout@v4
108+
- uses: ./.github/actions/setup
109+
- name: build
110+
env:
111+
ALL_SUPPORTED_BROWSERS: true
112+
run: pnpm vite build --mode=development
113+
114+
- name: Set BrowserStack Local Identifier
115+
if: startsWith(github.ref, 'refs/tags/v') && endsWith(github.ref, '-ember-source')
116+
run: |
117+
BROWSERSTACK_LOCAL_IDENTIFIER="$GITHUB_RUN_ID-$GITHUB_RUN_ATTEMPT"
118+
echo "BROWSERSTACK_LOCAL_IDENTIFIER=$BROWSERSTACK_LOCAL_IDENTIFIER" >> $GITHUB_ENV
119+
120+
- name: test:browserstack
121+
env:
122+
BROWSERSTACK_USERNAME: emberjscoreteam1
123+
# This is in plaintext on purpose. It has no privileged access to anything (this is a free
124+
# account) and it allows us to run browserstack tests against PRs.
125+
BROWSERSTACK_ACCESS_KEY: o5LNEdygq1SP4L9kst4s
126+
run: pnpm test:browserstack
127+
128+
smoke-test:
129+
name: Smoke tests (Full Ember Apps)
130+
runs-on: ubuntu-latest
131+
needs: [basic-test, lint, types]
132+
strategy:
133+
fail-fast: false
134+
matrix: ${{fromJson(needs.lint.outputs.matrix)}}
135+
steps:
136+
- uses: actions/checkout@v4
137+
- uses: ./.github/actions/setup
138+
with:
139+
use_lockfile: "false"
140+
- name: build
141+
run: pnpm build
142+
- name: test
143+
working-directory: smoke-tests/scenarios
144+
run: |
145+
${{ matrix.command }}
146+
147+
node-test:
148+
name: Node.js Tests
149+
runs-on: ubuntu-latest
150+
needs: [basic-test, lint, types]
151+
steps:
152+
- uses: actions/checkout@v4
153+
- uses: ./.github/actions/setup
154+
- name: build
155+
env:
156+
SHOULD_TRANSPILE_FOR_NODE: true
157+
run: pnpm build
158+
- name: test
159+
run: pnpm test:node
160+
161+
blueprint-test:
162+
name: Blueprint Tests
163+
runs-on: ubuntu-latest
164+
needs: [lint]
165+
steps:
166+
- uses: actions/checkout@v4
167+
- uses: ./.github/actions/setup
168+
- name: test
169+
run: pnpm test:blueprints
170+
171+
browser-test:
172+
name: Browser Tests (Firefox)
173+
runs-on: ubuntu-22.04 # Firefox is not installing on Ubuntu 24 on GitHub Actions https://github.com/browser-actions/setup-firefox/issues/622
174+
needs: [basic-test, lint, types]
175+
steps:
176+
- uses: actions/checkout@v4
177+
- uses: ./.github/actions/setup
178+
- name: build
179+
run: pnpm vite build --mode=development
180+
- name: Setup firefox
181+
uses: browser-actions/setup-firefox@latest
182+
with:
183+
firefox-version: 115.9.1esr
184+
- run: firefox --version
185+
- name: test
186+
run: pnpm ember test --path dist -c testem.ci-browsers.js

0 commit comments

Comments
 (0)