Skip to content
This repository was archived by the owner on Dec 18, 2024. It is now read-only.

Commit 24cd34b

Browse files
committed
ci: convert main CI workflow to Github Actions
The CircleCI based CI workflow for the main branch and all potential release branches is now execute via Github Actions. The CircleCI configuration temporarily is still present with an automatically passing test to prevent CircleCI failure. An additional direct build step has also been added to the build job for both PR and main CI workflows to ensure that the build that occurs during the deployment script continues to function.
1 parent daae318 commit 24cd34b

File tree

3 files changed

+86
-111
lines changed

3 files changed

+86
-111
lines changed

.circleci/config.yml

+6-109
Original file line numberDiff line numberDiff line change
@@ -1,119 +1,16 @@
1-
# Note: YAML anchors allow an object to be re-used, reducing duplication.
2-
# The ampersand declares an alias for an object, then later the `<<: *name`
3-
# syntax dereferences it.
4-
# See https://blog.daemonl.com/2016/02/yaml.html
5-
# To validate changes, use an online parser, eg.
6-
# https://yaml-online-parser.appspot.com/
1+
# This config is remaining in place to prevent pull requests failing because of CircleCI config missing.
72

8-
# CircleCI configuration version
9-
# Version 2.1 allows for extra config reuse features
10-
# https://circleci.com/docs/2.0/reusing-config/#getting-started-with-config-reuse
113
version: 2.1
124

13-
orbs:
14-
browser-tools: circleci/[email protected]
15-
devinfra: angular/[email protected]
16-
17-
# Cache key for CircleCI. We want to invalidate the cache whenever the Yarn lock file changes.
18-
var_1: &cache_key material-angular-io-{{ .Branch }}-{{ checksum "yarn.lock" }}
19-
var_2: &default_docker_image cimg/node:20.11.1-browsers
20-
21-
# Settings common to each job
22-
var_3: &job_defaults
23-
working_directory: ~/material-angular-io
24-
docker:
25-
- image: *default_docker_image
26-
27-
var_4: &save_cache
28-
save_cache:
29-
key: *cache_key
30-
paths:
31-
- 'node_modules'
32-
33-
var_5: &yarn_install
34-
run:
35-
name: 'Installing project dependencies'
36-
command: yarn install --immutable
37-
no_output_timeout: 20m
38-
39-
# https://circleci.com/docs/2.0/workflows/#using-workspaces-to-share-data-among-jobs
40-
# https://circleci.com/blog/deep-diving-into-circleci-workspaces/
41-
var_6: &workspace_location ~/
42-
43-
commands:
44-
store_build_output:
45-
description: 'Stores build artifacts'
46-
steps:
47-
- run:
48-
name: Move compiled apps to workspace
49-
command: |
50-
set -exu
51-
mkdir -p ~/dist
52-
mv dist/* ~/dist/
53-
- persist_to_workspace:
54-
root: *workspace_location
55-
paths:
56-
- dist
57-
585
jobs:
59-
lint:
60-
<<: *job_defaults
61-
steps:
62-
- checkout
63-
- restore_cache:
64-
key: *cache_key
65-
- *yarn_install
66-
- run: yarn lint
67-
- *save_cache
68-
69-
build:
70-
<<: *job_defaults
71-
# We generate a lot of chunks with our build. To improve stability and to reduce
72-
# the amount it takes to run, we use a higher resource class with better VM specs.
73-
# https://circleci.com/docs/2.0/configuration-reference/#resource_class
74-
resource_class: large
75-
steps:
76-
- checkout
77-
- restore_cache:
78-
key: *cache_key
79-
- *yarn_install
80-
- run: yarn prod-build
81-
- *save_cache
82-
- store_build_output
83-
84-
test:
85-
<<: *job_defaults
86-
steps:
87-
- checkout
88-
- restore_cache:
89-
key: *cache_key
90-
- *yarn_install
91-
- browser-tools/install-browser-tools
92-
- run: yarn test --watch false --progress=false
93-
94-
lighthouse_audits:
95-
<<: *job_defaults
6+
pass:
7+
docker:
8+
- image: cimg/base:2022.05
969
steps:
97-
- attach_workspace:
98-
at: *workspace_location
99-
- checkout
100-
- browser-tools/install-chrome
101-
- restore_cache:
102-
key: *cache_key
103-
- *yarn_install
104-
- browser-tools/install-browser-tools
105-
- run:
106-
command: yarn test:audit:ci
107-
environment:
108-
CHROMIUM_BIN: '/usr/bin/google-chrome'
10+
- run: echo "This too shall pass (always)"
10911

11012
workflows:
11113
version: 2
11214
default_workflow:
11315
jobs:
114-
- lint
115-
- build
116-
- test
117-
- lighthouse_audits:
118-
requires:
119-
- build
16+
- pass

.github/workflows/ci.yml

+76
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- "[0-9]+.[0-9]+.x"
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
permissions: {}
14+
15+
defaults:
16+
run:
17+
shell: bash
18+
19+
env:
20+
# TODO: Remove when pnpm is exclusively used.
21+
ASPECT_RULES_JS_FROZEN_PNPM_LOCK: "1"
22+
23+
jobs:
24+
lint:
25+
runs-on: ubuntu-latest
26+
steps:
27+
- name: Initialize environment
28+
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@db91da4e742cd081bfba01db2edc4e816018419b
29+
- name: Install node modules
30+
run: yarn install --immutable
31+
- name: Execute Linting
32+
run: yarn bazel test --test_tag_filters=lint //...
33+
34+
build:
35+
runs-on: ubuntu-latest
36+
steps:
37+
- name: Initialize environment
38+
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@db91da4e742cd081bfba01db2edc4e816018419b
39+
- name: Install node modules
40+
run: yarn install --immutable
41+
- name: Execute Direct Production Build (deploy usage)
42+
run: yarn prod-build
43+
- name: Execute Build via Bazel
44+
run: yarn bazel build //...
45+
46+
test:
47+
runs-on: ubuntu-latest
48+
steps:
49+
- name: Initialize environment
50+
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@db91da4e742cd081bfba01db2edc4e816018419b
51+
- name: Install node modules
52+
run: yarn install --immutable
53+
- name: Execute Tests
54+
run: yarn bazel test --test_tag_filters=-lint,-e2e,-audit //...
55+
- name: Store Test Logs
56+
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
57+
with:
58+
name: test-logs
59+
path: bazel-testlogs/
60+
retention-days: 14
61+
62+
lighthouse:
63+
runs-on: ubuntu-latest
64+
steps:
65+
- name: Initialize environment
66+
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@db91da4e742cd081bfba01db2edc4e816018419b
67+
- name: Install node modules
68+
run: yarn install --immutable
69+
- name: Execute Lighthouse Audit
70+
run: yarn bazel test --test_tag_filters=audit //...
71+
- name: Store Audit Logs
72+
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
73+
with:
74+
name: lighthouse-logs
75+
path: bazel-testlogs/
76+
retention-days: 14

.github/workflows/pr.yml

+4-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ defaults:
1616

1717
env:
1818
# TODO: Remove when pnpm is exclusively used.
19-
ASPECT_RULES_JS_FROZEN_PNPM_LOCK: '1'
19+
ASPECT_RULES_JS_FROZEN_PNPM_LOCK: "1"
2020

2121
jobs:
2222
lint:
@@ -36,7 +36,9 @@ jobs:
3636
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@db91da4e742cd081bfba01db2edc4e816018419b
3737
- name: Install node modules
3838
run: yarn install --immutable
39-
- name: Execute Build
39+
- name: Execute Direct Production Build (deploy usage)
40+
run: yarn prod-build
41+
- name: Execute Build via Bazel
4042
run: yarn bazel build //...
4143

4244
test:

0 commit comments

Comments
 (0)