Commit 9d829356 authored by Raffaele's avatar Raffaele Committed by GitHub

migrate github actions to circleci (#12928)

* migrate close-stale github action

* using external script

* completing script

* removing old github action

* example only

* removing versions

* removing tag-service
parent b322d5be
......@@ -41,6 +41,9 @@ parameters:
publish_contract_artifacts_dispatch:
type: boolean
default: false
stale_check_dispatch:
type: boolean
default: false
orbs:
go: circleci/go@1.8.0
......@@ -347,7 +350,7 @@ jobs:
machine:
image: <<pipeline.parameters.base_image>>
resource_class: "<<parameters.resource_class>>"
docker_layer_caching: true # we rely on this for faster builds, and actively warm it up for builds with common stages
docker_layer_caching: true # we rely on this for faster builds, and actively warm it up for builds with common stages
steps:
- checkout
- attach_workspace:
......@@ -458,7 +461,7 @@ jobs:
docker save -o /tmp/docker_images/<<parameters.docker_name>>.tar $IMAGE_NAME
- persist_to_workspace:
root: /tmp/docker_images
paths: # only write the one file, to avoid concurrent workspace-file additions
paths: # only write the one file, to avoid concurrent workspace-file additions
- "<<parameters.docker_name>>.tar"
- when:
condition: "<<parameters.release>>"
......@@ -471,11 +474,11 @@ jobs:
condition:
or:
- and:
- "<<parameters.publish>>"
- "<<parameters.release>>"
- "<<parameters.publish>>"
- "<<parameters.release>>"
- and:
- "<<parameters.publish>>"
- equal: [develop, << pipeline.git.branch >>]
- "<<parameters.publish>>"
- equal: [develop, << pipeline.git.branch >>]
steps:
- gcp-oidc-authenticate:
service_account_email: GCP_SERVICE_ATTESTOR_ACCOUNT_EMAIL
......@@ -1001,8 +1004,7 @@ jobs:
steps:
- checkout
- setup_remote_docker
- run:
make -C op-program verify-reproducibility
- run: make -C op-program verify-reproducibility
- notify-failures-on-develop:
mentions: "@proofs-team"
......@@ -1054,7 +1056,7 @@ jobs:
- checkout
- unless:
condition:
equal: [ "develop", << pipeline.git.branch >> ]
equal: ["develop", << pipeline.git.branch >>]
steps:
- run:
# Scan changed files in PRs, block on new issues only (existing issues ignored)
......@@ -1110,7 +1112,7 @@ jobs:
paths:
- "/go/pkg/mod"
bedrock-go-tests: # just a helper, that depends on all the actual test jobs
bedrock-go-tests: # just a helper, that depends on all the actual test jobs
docker:
# Use a smaller base image to avoid pulling the huge ci-builder
# image which is not needed for this job and sometimes misses
......@@ -1272,17 +1274,29 @@ jobs:
command: |
goreleaser release --clean -f ./<<parameters.module>>/<<parameters.filename>>
stale-check:
docker:
- image: cimg/python:3.11
steps:
- run:
name: Run Stale Check Script
command: |
git clone --branch main --depth 1 https://github.com/ethereum-optimism/circleci-utils.git /tmp/circleci-utils
cd /tmp/circleci-utils/stale-check
pip3 install -r requirements.txt
python3 stale-check.py --repo "ethereum-optimism/${CIRCLE_PROJECT_REPONAME}" --github-token "${STALE_GITHUB_TOKEN}"
workflows:
main:
when:
and:
- or:
# Trigger on new commits
- equal: [ webhook, << pipeline.trigger_source >> ]
- equal: [webhook, << pipeline.trigger_source >>]
# Trigger on manual triggers if explicitly requested
- equal: [ true, << pipeline.parameters.main_dispatch >> ]
- equal: [true, << pipeline.parameters.main_dispatch >>]
- not:
equal: [ scheduled_pipeline, << pipeline.trigger_source >> ]
equal: [scheduled_pipeline, << pipeline.trigger_source >>]
jobs:
- go-mod-download
- contracts-bedrock-build:
......@@ -1426,7 +1440,7 @@ workflows:
notify: true
matrix:
parameters:
mips_word_size: [ 32, 64 ]
mips_word_size: [32, 64]
- cannon-build-test-vectors
- todo-issues:
name: todo-issues-check
......@@ -1435,8 +1449,7 @@ workflows:
name: shell-check
# We don't need the `exclude` key as the orb detects the `.shellcheckrc`
dir: .
ignore-dirs:
./packages/contracts-bedrock/lib
ignore-dirs: ./packages/contracts-bedrock/lib
go-release-deployer:
jobs:
......@@ -1453,7 +1466,7 @@ workflows:
release:
when:
not:
equal: [ scheduled_pipeline, << pipeline.trigger_source >> ]
equal: [scheduled_pipeline, << pipeline.trigger_source >>]
jobs:
# Wait for approval on the release
- hold:
......@@ -1546,7 +1559,7 @@ workflows:
scheduled-todo-issues:
when:
equal: [ build_four_hours, <<pipeline.schedule.name>> ]
equal: [build_four_hours, <<pipeline.schedule.name>>]
jobs:
- todo-issues:
name: todo-issue-checks
......@@ -1555,7 +1568,7 @@ workflows:
scheduled-fpp:
when:
equal: [ build_hourly, <<pipeline.schedule.name>> ]
equal: [build_hourly, <<pipeline.schedule.name>>]
jobs:
- fpp-verify:
context:
......@@ -1565,8 +1578,9 @@ workflows:
develop-publish-contract-artifacts:
when:
or:
- equal: [ "develop", <<pipeline.git.branch>> ]
- equal: [ true, <<pipeline.parameters.publish_contract_artifacts_dispatch>> ]
- equal: ["develop", <<pipeline.git.branch>>]
- equal:
[true, <<pipeline.parameters.publish_contract_artifacts_dispatch>>]
jobs:
- publish-contract-artifacts
......@@ -1574,10 +1588,10 @@ workflows:
when:
and:
- or:
- equal: [ "develop", <<pipeline.git.branch>> ]
- equal: [ true, <<pipeline.parameters.fault_proofs_dispatch>> ]
- equal: ["develop", <<pipeline.git.branch>>]
- equal: [true, <<pipeline.parameters.fault_proofs_dispatch>>]
- not:
equal: [ scheduled_pipeline, << pipeline.trigger_source >> ]
equal: [scheduled_pipeline, << pipeline.trigger_source >>]
jobs:
- go-mod-download
- cannon-prestate
......@@ -1607,10 +1621,10 @@ workflows:
when:
and:
- or:
- equal: [ "develop", <<pipeline.git.branch>> ]
- equal: [ true, <<pipeline.parameters.kontrol_dispatch>> ]
- equal: ["develop", <<pipeline.git.branch>>]
- equal: [true, <<pipeline.parameters.kontrol_dispatch>>]
- not:
equal: [ scheduled_pipeline, << pipeline.trigger_source >> ]
equal: [scheduled_pipeline, << pipeline.trigger_source >>]
jobs:
- kontrol-tests:
context:
......@@ -1620,8 +1634,8 @@ workflows:
scheduled-cannon-full-tests:
when:
or:
- equal: [ build_four_hours, <<pipeline.schedule.name>> ]
- equal: [ true, << pipeline.parameters.cannon_full_test_dispatch >> ]
- equal: [build_four_hours, <<pipeline.schedule.name>>]
- equal: [true, << pipeline.parameters.cannon_full_test_dispatch >>]
jobs:
- contracts-bedrock-build:
skip_pattern: test
......@@ -1633,14 +1647,14 @@ workflows:
- slack
matrix:
parameters:
mips_word_size: [ 32, 64 ]
mips_word_size: [32, 64]
scheduled-docker-publish:
when:
or:
- equal: [ build_hourly, <<pipeline.schedule.name>> ]
- equal: [build_hourly, <<pipeline.schedule.name>>]
# Trigger on manual triggers if explicitly requested
- equal: [ true, << pipeline.parameters.docker_publish_dispatch >> ]
- equal: [true, << pipeline.parameters.docker_publish_dispatch >>]
jobs:
- docker-build:
matrix:
......@@ -1691,10 +1705,19 @@ workflows:
scheduled-preimage-reproducibility:
when:
or:
- equal: [build_daily, <<pipeline.schedule.name>> ]
- equal: [build_daily, <<pipeline.schedule.name>>]
# Trigger on manual triggers if explicitly requested
- equal: [ true, << pipeline.parameters.reproducibility_dispatch >> ]
- equal: [true, << pipeline.parameters.reproducibility_dispatch >>]
jobs:
- preimage-reproducibility:
context:
slack
context: slack
scheduled-stale-check:
when:
or:
- equal: [build_daily, <<pipeline.schedule.name>>]
# Trigger on manual triggers if explicitly requested
- equal: [true, << pipeline.parameters.stale_check_dispatch >>]
jobs:
- stale-check:
context: github-token-stale-check
name: 'Close stale issues and PRs'
on:
schedule:
- cron: '30 1 * * *'
jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v9
with:
stale-pr-message: 'This PR is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 5 days.'
stale-issue-label: 'S-stale'
exempt-pr-labels: 'S-exempt-stale'
days-before-issue-stale: 999
days-before-pr-stale: 14
days-before-close: 5
repo-token: ${{ secrets.GITHUB_TOKEN }}
name: Tag Service
on:
workflow_dispatch:
inputs:
bump:
description: 'How much to bump the version by'
required: true
type: choice
options:
- major
- minor
- patch
- prerelease
- finalize-prerelease
service:
description: 'Which service to release'
required: true
type: choice
options:
- ci-builder
- ci-builder-rust
- op-node
- op-batcher
- op-proposer
- op-challenger
- op-program
- op-dispute-mon
- op-ufm
- da-server
- op-contracts
- op-conductor
prerelease:
description: Increment major/minor/patch as prerelease?
required: false
type: boolean
default: false
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
environment: op-stack-production
steps:
- uses: actions/checkout@v4
- name: Fetch tags
run: git fetch --tags origin --force
- name: Setup Python 3.10
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install deps
run: pip install -r requirements.txt
working-directory: ops/tag-service
- run: ops/tag-service/tag-service.py --bump="$BUMP" --service="$SERVICE"
env:
INPUT_GITHUB_TOKEN: ${{ github.token }}
BUMP: ${{ github.event.inputs.bump }}
SERVICE: ${{ github.event.inputs.service }}
if: ${{ github.event.inputs.prerelease == 'false' }}
- run: ops/tag-service/tag-service.py --bump="$BUMP" --service="$SERVICE" --pre-release
env:
INPUT_GITHUB_TOKEN: ${{ github.token }}
BUMP: ${{ github.event.inputs.bump }}
SERVICE: ${{ github.event.inputs.service }}
if: ${{ github.event.inputs.prerelease == 'true' }}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment