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

Commit

Permalink
ci: convert bazel jobs to a PR Github Action workflow
Browse files Browse the repository at this point in the history
The Bazel variants of the existing CircleCI configuration have now been
moved to a PR workflow for Github Actions. This is a first step to fully
converting to the use of Github Actions within the repository. The non-Bazel
jobs currently still executing with CircleCI both for PRs and main CI.
  • Loading branch information
clydin committed Aug 15, 2024
1 parent 025d974 commit f69f69e
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 69 deletions.
68 changes: 0 additions & 68 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,70 +107,6 @@ jobs:
environment:
CHROMIUM_BIN: '/usr/bin/google-chrome'

bazel-build:
<<: *job_defaults
resource_class: large
steps:
- checkout
- restore_cache:
key: *cache_key
- *yarn_install
- run:
command: yarn bazel build //...
environment:
# TODO: Remove when pnpm is exclusively used.
ASPECT_RULES_JS_FROZEN_PNPM_LOCK: '1'
- *save_cache

bazel-test:
<<: *job_defaults
resource_class: large
steps:
- checkout
- restore_cache:
key: *cache_key
- *yarn_install
- run:
command: yarn bazel test --test_tag_filters=-lint,-e2e,-audit //...
environment:
# TODO: Remove when pnpm is exclusively used.
ASPECT_RULES_JS_FROZEN_PNPM_LOCK: '1'
- *save_cache
- store_artifacts:
path: bazel-testlogs/
- store_artifacts:
path: bazel-testlogs/scenes/

bazel-lint:
<<: *job_defaults
resource_class: large
steps:
- checkout
- restore_cache:
key: *cache_key
- *yarn_install
- run: yarn bazel test --test_tag_filters=+lint //...
- *save_cache
- store_artifacts:
path: bazel-testlogs/
- store_artifacts:
path: bazel-testlogs/scenes/

bazel-lighthouse_audits:
<<: *job_defaults
resource_class: xlarge
steps:
- checkout
- restore_cache:
key: *cache_key
- *yarn_install
- run: yarn bazel test --test_tag_filters=+audit //...
- *save_cache
- store_artifacts:
path: bazel-testlogs/
- store_artifacts:
path: bazel-testlogs/scenes/

workflows:
version: 2
default_workflow:
Expand All @@ -181,7 +117,3 @@ workflows:
- lighthouse_audits:
requires:
- build
- bazel-build
- bazel-test
- bazel-lighthouse_audits
- bazel-lint
72 changes: 72 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Pull Request

on:
pull_request:
types: [opened, synchronize, reopened]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions: {}

defaults:
run:
shell: bash

env:
# TODO: Remove when pnpm is exclusively used.
ASPECT_RULES_JS_FROZEN_PNPM_LOCK: '1'

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@db91da4e742cd081bfba01db2edc4e816018419b
- name: Install node modules
run: yarn install
- name: Execute Linting
run: yarn bazel test --test_tag_filters=lint //...

build:
runs-on: ubuntu-latest
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@db91da4e742cd081bfba01db2edc4e816018419b
- name: Install node modules
run: yarn install
- name: Execute Build
run: yarn bazel build //...

test:
runs-on: ubuntu-latest
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@db91da4e742cd081bfba01db2edc4e816018419b
- name: Install node modules
run: yarn install
- name: Execute Tests
run: yarn bazel test --test_tag_filters=-lint,-e2e,-audit //...
- name: Store Test Logs
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
with:
name: test-logs
path: bazel-testlogs/
retention-days: 14

lighthouse:
runs-on: ubuntu-latest
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@db91da4e742cd081bfba01db2edc4e816018419b
- name: Install node modules
run: yarn install
- name: Execute Lighthouse Audit
run: yarn bazel test --test_tag_filters=audit //...
- name: Store Audit Logs
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
with:
name: lighthouse-logs
path: bazel-testlogs/
retention-days: 14
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20.11.0
20.16.0

0 comments on commit f69f69e

Please sign in to comment.