Skip to content

Migration GitHub to circleci #1185

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 43 commits into from
Dec 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
5c230e3
add CircleCI configuration for linting job
raffaele-oplabs Dec 19, 2024
6e42d0d
add lint job to CircleCI configuration
raffaele-oplabs Dec 19, 2024
2e5a375
rename lint job to publish-algolia-search in CircleCI configuration
raffaele-oplabs Dec 19, 2024
c56cb25
update CircleCI configuration to use Ubuntu 22.04 and Node.js 16.13 f…
raffaele-oplabs Dec 19, 2024
f3e6fc4
refactor CircleCI configuration to use machine executor and pnpm for …
raffaele-oplabs Dec 19, 2024
b58f990
add Node.js orb to CircleCI configuration
raffaele-oplabs Dec 19, 2024
3b957e0
update CircleCI configuration to install packages using npm and run t…
raffaele-oplabs Dec 19, 2024
bdd0bec
update CircleCI configuration to use pnpm for package management in t…
raffaele-oplabs Dec 19, 2024
8521612
update CircleCI configuration to install Node.js 20.x and pnpm, and m…
raffaele-oplabs Dec 19, 2024
14ed9fb
refactor CircleCI configuration to use a dedicated Node.js 20.x execu…
raffaele-oplabs Dec 19, 2024
eed1de7
simplify dependency installation in CircleCI configuration by removin…
raffaele-oplabs Dec 19, 2024
b84d490
enable index documentation creation and upload in CircleCI configuration
raffaele-oplabs Dec 19, 2024
d1e09ab
update CircleCI configuration to use Ubuntu executor and install Node…
raffaele-oplabs Dec 19, 2024
cb3cbe2
remove commented-out environment variables from CircleCI configuration
raffaele-oplabs Dec 19, 2024
d7d7e7a
restore environment variables for index documentation creation in Cir…
raffaele-oplabs Dec 19, 2024
d3dc09c
refactor CircleCI configuration to create and upload Algolia search i…
raffaele-oplabs Dec 19, 2024
451550a
refactor CircleCI configuration to add breadcrumbs job and update Alg…
raffaele-oplabs Dec 19, 2024
73390e6
update CircleCI configuration to enable filters for breadcrumbs job o…
raffaele-oplabs Dec 19, 2024
48b0b60
refactor CircleCI configuration to inline Algolia index creation command
raffaele-oplabs Dec 19, 2024
e07f703
add CircleCI job to build and run Lychee link checker
raffaele-oplabs Dec 19, 2024
c45b557
refactor CircleCI configuration to set Lychee path in the run command
raffaele-oplabs Dec 19, 2024
01d53bb
refactor CircleCI configuration to create separate workflows for Algo…
raffaele-oplabs Dec 19, 2024
801f058
refactor CircleCI configuration to rename workflows for clarity
raffaele-oplabs Dec 19, 2024
da804b7
refactor CircleCI configuration to simplify workflow job definitions
raffaele-oplabs Dec 19, 2024
0f74e6f
add CircleCI job to lint Markdown files
raffaele-oplabs Dec 19, 2024
d9583c3
add setup-node step to CircleCI job for linting Markdown files
raffaele-oplabs Dec 19, 2024
bc5b6cf
add developer metrics jobs to CircleCI configuration
raffaele-oplabs Dec 19, 2024
4b05cf5
add Slack notifications for job failures and new tutorial workflows i…
raffaele-oplabs Dec 20, 2024
c916d46
Merge branch 'main' into migration-github-to-circleci
raffaele-oplabs Dec 20, 2024
5a77383
remove commented-out Algolia job configuration from CircleCI
raffaele-oplabs Dec 20, 2024
5695cbf
update job name to reflect index creation and upload in CircleCI conf…
raffaele-oplabs Dec 20, 2024
671985a
refactor CircleCI configuration to use environment variable names dir…
raffaele-oplabs Dec 20, 2024
48726a7
add debug step to CircleCI configuration and use environment variable…
raffaele-oplabs Dec 20, 2024
348b513
add environment variable for ALGOLIA_INDEX_NAME in CircleCI job
raffaele-oplabs Dec 20, 2024
0881cee
remove debug step and unnecessary environment variables from CircleCI…
raffaele-oplabs Dec 20, 2024
d84ca0a
update job name for Algolia index update in CircleCI configuration
raffaele-oplabs Dec 20, 2024
18f8209
remove unused GitHub workflows for Algolia index update, breadcrumbs,…
raffaele-oplabs Dec 20, 2024
5e0852d
rename developer-issue-metrics job to developer-metrics and remove de…
raffaele-oplabs Dec 20, 2024
fc63b70
rename developer-metrics job to developer-issue-metrics and add devel…
raffaele-oplabs Dec 20, 2024
214be75
rename developer-issue-metrics job to developer-metrics and remove de…
raffaele-oplabs Dec 20, 2024
61961ed
update file paths for issue and PR metrics in CircleCI configuration
raffaele-oplabs Dec 20, 2024
cf471ef
update CircleCI utils orb version to 0.0.7
raffaele-oplabs Dec 20, 2024
7074017
refactor CircleCI configuration: remove unused jobs and notifications…
raffaele-oplabs Dec 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
171 changes: 171 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
version: 2.1
orbs:
utils: ethereum-optimism/circleci-utils@0.0.7

executors:
node20:
docker:
- image: cimg/node:20.11.1 # Prebuilt CircleCI image for Node.js 20.x
resource_class: medium # Adjust resource allocation as needed
ubuntu:
machine:
image: ubuntu-2204:current
rust:
docker:
- image: cimg/rust:1.75.0 # CircleCI's Rust Docker image
working_directory: ~/project

commands:
setup-node:
steps:
- run:
name: Install Node.js (20.x) and pnpm
command: |
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt-get install -y nodejs
npm install -g pnpm
pnpm --version
- restore_cache:
keys:
- v1-pnpm-cache-{{ checksum "pnpm-lock.yaml" }}
- run:
name: Install dependencies
command: npm install -g pnpm && pnpm install
- save_cache:
key: v1-pnpm-cache-{{ checksum "pnpm-lock.yaml" }}
paths:
- ~/.pnpm-store

jobs:
algolia:
description: Create and upload Algolia search index
executor: ubuntu
steps:
- checkout
- setup-node
- run:
name: Create and upload index
command: |
# index:docs requires the following environment variables, coming from the algolia-search context
# ALGOLIA_APPLICATION_ID
# ALGOLIA_WRITE_API_KEY
# ALGOLIA_INDEX_NAME
pnpm run index:docs

breadcrumbs:
description: Check breadcrumbs in documentation
executor: ubuntu
steps:
- checkout
- setup-node
- run:
name: Run breadcrumb check
command: pnpm check-breadcrumbs
lint:
description: Lint Markdown files
executor: ubuntu
steps:
- checkout
- setup-node
- run:
name: Lint Markdown files
command: pnpm lint

links:
executor: rust
steps:
- checkout:
path: docs
- run:
name: Checkout lycheeverse/lychee
command: |
git clone https://github.com/lycheeverse/lychee.git lychee

- restore_cache:
keys:
- v1-rust-cache-{{ checksum "lychee/Cargo.lock" }}
- v1-rust-cache-

- run:
name: Build Lychee
command: |
cd lychee
cargo build --release

- save_cache:
key: v1-rust-cache-{{ checksum "lychee/Cargo.lock" }}
paths:
- ~/.cargo/registry
- ~/.cargo/git
- lychee/target

- run:
name: Run Lychee link checker
command: |
export PATH=$PATH:$HOME/project/lychee/target/release
cd docs
lychee --config ./lychee.toml --quiet "./pages"

developer-metrics:
description: Monthly Metrics Report
executor: ubuntu
parameters:
repo:
type: string
default: $CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME
steps:
- utils/get-github-access-token:
private-key-str: GITHUB_APP_KEY
app-id: GITHUB_APP_ID
repo: << parameters.repo >>
- run:
name: Get Dates for Last Month
command: |
# Calculate the first day of the previous month
first_day=$(date -d "last month" +%Y-%m-01)


# Calculate the last day of the previous month
last_day=$(date -d "$first_day +1 month -1 day" +%Y-%m-%d)

# Export the last_month variable for subsequent steps
echo "export LAST_MONTH=${first_day}..${last_day}" >> $BASH_ENV
- utils/generate-issue-metrics-file:
SEARCH_QUERY: 'repo:ethereum-optimism/docs is:issue closed:${LAST_MONTH} -reason:\"not planned\" -label:monthly-report'
file-path: "./closed_issue_metrics.md"
- utils/create-github-issue-from-file:
repo: << parameters.repo >>
file-path: "./closed_issue_metrics.md"
issue-title: "${LAST_MONTH} metrics report for closed issues"
issue-labels: "monthly-report"
assignees: "sbvegan"
- utils/generate-issue-metrics-file:
SEARCH_QUERY: "repo:ethereum-optimism/docs is:pr created:${LAST_MONTH}"
file-path: "./pr_issue_metrics.md"
- utils/create-github-issue-from-file:
repo: << parameters.repo >>
file-path: "./pr_issue_metrics.md"
issue-title: "${LAST_MONTH} metrics report for opened prs"
issue-labels: "monthly-report"
assignees: "sbvegan"

workflows:
merge-workflow:
jobs:
- algolia:
name: Algolia Index Update
context: algolia-search
filters:
branches:
only: main
pr-workflow:
jobs:
- breadcrumbs
- links
- lint
monthly-workflow:
when:
equal: [build_monthly, <<pipeline.schedule.name>>]
jobs:
- developer-metrics:
context: circleci-repo-docs
31 changes: 0 additions & 31 deletions .github/workflows/algolia.yml

This file was deleted.

32 changes: 0 additions & 32 deletions .github/workflows/breadcrumbs.yml

This file was deleted.

48 changes: 0 additions & 48 deletions .github/workflows/links.yml

This file was deleted.

29 changes: 0 additions & 29 deletions .github/workflows/lint.yml

This file was deleted.

60 changes: 0 additions & 60 deletions .github/workflows/monthly-issue-metircs.yml

This file was deleted.

Loading