Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
48 changes: 18 additions & 30 deletions .github/workflows/backport.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: Backport
on:
pull_request:
types: [closed]
permissions:
contents: read
jobs:
backport:
runs-on: ubuntu-22.04
Expand All @@ -10,36 +12,22 @@ jobs:
steps:
- name: Create Reminder for cherry-pick and assign it to pr author
env:
GH_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }}
REPO: ${{ github.repository }}
NUMBER: ${{ github.event.number }}
TITLE: ${{ github.event.pull_request.title }}
AUTHOR: ${{ github.event.pull_request.user.login }}
run: |
HTTP_RESPONSE=`curl -v -X "POST" "https://api.github.com/repos/${{ github.repository }}/issues" \
-H "Authorization: token ${{ secrets.REPO_ACCESS_TOKEN }}" \
-H "Content-Type: text/plain; charset=utf-8" \
--write-out "%{http_code}\n"\
-o /dev/null\
-d '{
"title": "Backport #${{ github.event.number }} '"$TITLE"'",
"body": "#${{ github.event.number }}",
"assignees": [
"${{ github.event.pull_request.user.login }}"
],
"labels": [
"s:backport-needed"
]
}'`

if [[ $HTTP_RESPONSE == '422' ]];then
echo "create issue without assignees"
curl -v -X "POST" "https://api.github.com/repos/${{ github.repository }}/issues" \
-H "Authorization: token ${{ secrets.REPO_ACCESS_TOKEN }}" \
-H "Content-Type: text/plain; charset=utf-8" \
--write-out "%{http_code}\n"\
-o /dev/null\
-d '{
"title": "Backport #${{ github.event.number }} '"$TITLE"'",
"body": "#${{ github.event.number }}",
"labels": [
"s:backport-needed"
]
}'
set -euo pipefail
issue_title="Backport #${NUMBER} ${TITLE}"
if ! gh api "repos/${REPO}/issues" \
-f title="$issue_title" \
-f body="#${NUMBER}" \
-f "assignees[]=${AUTHOR}" \
-f "labels[]=s:backport-needed"; then
echo "Creating the issue without an assignee"
gh api "repos/${REPO}/issues" \
-f title="$issue_title" \
-f body="#${NUMBER}" \
-f "labels[]=s:backport-needed"
fi
17 changes: 13 additions & 4 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,18 @@ on:
# Manurally trigger
workflow_dispatch:

permissions:
contents: read

jobs:
benchmark:
name: Benchmark
runs-on: ubuntu-22.04
if: |
(
github.event_name == 'pull_request_review' &&
contains(github.event.review.body, '#benchmark')
contains(github.event.review.body, '#benchmark') &&
contains(fromJSON('["OWNER","MEMBER","COLLABORATOR"]'), github.event.review.author_association)
) || (
github.event_name == 'schedule' &&
github.repository_owner == 'nervosnetwork'
Expand All @@ -32,12 +36,13 @@ jobs:
GITHUB_REPO: ${{ github.repository }}
GITHUB_EVENT_NAME: ${{ github.event_name }}
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
with:
repository: nervosnetwork/ckb-integration-test
ref: e6b6832752ffb10e064d96f5bf6bfbbe6fb03290
- name: Get branch name when event is pr review comments
if: github.event_name == 'pull_request_review' && contains(github.event.review.body, '#benchmark')
uses: xt0rted/pull-request-comment-branch@v1
uses: xt0rted/pull-request-comment-branch@653a7d5ca8bd91d3c5cb83286063314d0b063b8e # v1
id: comment-branch
- name: Get Current Date & Set ENV
id: date
Expand All @@ -49,8 +54,12 @@ jobs:
- name: Start
env:
JOB_ID: "benchmark-${{ github.repository_owner }}-${{ github.ref_name }}-${{ steps.date.outputs.date }}-in-10h"
HEAD_REF: ${{ steps.comment-branch.outputs.head_ref }}
run: |
export GITHUB_BRANCH=${{ steps.comment-branch.outputs.head_ref }}
if [ -n "$HEAD_REF" ]; then
git check-ref-format --branch "$HEAD_REF"
fi
export GITHUB_BRANCH="$HEAD_REF"
./ckb-bench/devtools/ci/script/benchmark.sh run
- name: Set test state when benchmark success.
if: ${{ success() }}
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/build_ckb_image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
version: ${{ steps.validate.outputs.version }}
steps:
- name: Checkout repository
uses: actions/checkout@v6
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
with:
fetch-depth: 0

Expand Down Expand Up @@ -49,7 +49,7 @@ jobs:
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v6
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
with:
fetch-depth: 0
- name: Checkout specific tag
Expand All @@ -61,7 +61,7 @@ jobs:
run: |
docker version
- name: Log in to Docker Hub
uses: docker/login-action@v3
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
Expand All @@ -82,7 +82,7 @@ jobs:
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v6
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
with:
fetch-depth: 0
- name: Checkout specific tag
Expand All @@ -94,7 +94,7 @@ jobs:
run: |
docker version
- name: Log in to Docker Hub
uses: docker/login-action@v3
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
Expand All @@ -118,7 +118,7 @@ jobs:
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v6
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
with:
fetch-depth: 0
- name: Validate version (for output)
Expand All @@ -128,7 +128,7 @@ jobs:
run: |
printf 'version=%s\n' "$VERSION" >> "$GITHUB_OUTPUT"
- name: Log in to Docker Hub
uses: docker/login-action@v3
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
Expand Down Expand Up @@ -158,7 +158,7 @@ jobs:
- name: Notify Discord on success
if: needs.create-manifest.result == 'success'
continue-on-error: true
uses: sarisia/actions-status-discord@v1
uses: sarisia/actions-status-discord@74e2ad0c4e57ca8b9ba6aee75d5a7841497bbb87 # v1
with:
webhook: ${{ secrets.DISCORD_WEBHOOK }}
title: "CKB Docker Build Succeeded"
Expand All @@ -167,7 +167,7 @@ jobs:
- name: Notify Discord on failure
if: needs.create-manifest.result != 'success'
continue-on-error: true
uses: sarisia/actions-status-discord@v1
uses: sarisia/actions-status-discord@74e2ad0c4e57ca8b9ba6aee75d5a7841497bbb87 # v1
with:
webhook: ${{ secrets.DISCORD_WEBHOOK }}
title: "CKB Docker Build Failed"
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/ci_aarch64_build_ubuntu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: full
RUSTFLAGS: -D warnings
permissions:
contents: read

jobs:
ci_aarch64_build_ubuntu:
name: ci_aarch64_build_ubuntu
Expand All @@ -31,16 +34,16 @@ jobs:
sudo rm -rf /opt/ghc
sudo rm -rf /opt/hostedtoolcache/CodeQL
sudo docker image prune --all --force
- uses: actions/checkout@v6
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
- name: Cache cargo target
if: github.event_name == 'pull_request' || (github.event_name == 'push' && github.ref != 'refs/heads/develop' && github.ref != 'refs/heads/master' && !startsWith(github.ref, 'refs/heads/rc/') && !startsWith(github.ref, 'refs/heads/pkg/'))
uses: actions/cache@v5
uses: actions/cache@caa296126883cff596d87d8935842f9db880ef25 # v5
with:
path: target
key: ci-aarch64-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
ci-aarch64-cargo-
- uses: dtolnay/rust-toolchain@master
- uses: dtolnay/rust-toolchain@df2a88e9fe4098bad09cb42c3dec7187f15861fc # master
with:
toolchain: 1.95.0
components: rustfmt
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/ci_benchmarks_macos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: full
RUSTFLAGS: -D warnings
permissions:
contents: read

jobs:
ci_benchmarks_macos:
name: ci_benchmarks_macos
Expand All @@ -27,10 +30,10 @@ jobs:
sudo rm -rf /Applications/Xcode_*.app
sudo rm -rf /usr/local/lib/android
brew cleanup
- uses: actions/checkout@v6
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
- name: Cache cargo target
if: github.event_name == 'pull_request' || (github.event_name == 'push' && github.ref != 'refs/heads/develop' && github.ref != 'refs/heads/master' && !startsWith(github.ref, 'refs/heads/rc/') && !startsWith(github.ref, 'refs/heads/pkg/'))
uses: actions/cache@v5
uses: actions/cache@caa296126883cff596d87d8935842f9db880ef25 # v5
with:
path: target
key: ci-${{ runner.os }}-cargo-bench-${{ hashFiles('**/Cargo.lock') }}
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/ci_benchmarks_ubuntu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: full
RUSTFLAGS: -D warnings
permissions:
contents: read

jobs:
ci_benchmarks_ubuntu:
name: ci_benchmarks_ubuntu
Expand All @@ -27,15 +30,15 @@ jobs:
sudo rm -rf /opt/ghc
sudo rm -rf /opt/hostedtoolcache/CodeQL
sudo docker image prune --all --force
- uses: dtolnay/rust-toolchain@master
- uses: dtolnay/rust-toolchain@df2a88e9fe4098bad09cb42c3dec7187f15861fc # master
with:
toolchain: 1.95.0
components: rustfmt, clippy
- run: sudo apt-get update && sudo apt-get install -y libssl-dev pkg-config libclang-dev build-essential
- uses: actions/checkout@v6
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
- name: Cache cargo target
if: github.event_name == 'pull_request' || (github.event_name == 'push' && github.ref != 'refs/heads/develop' && github.ref != 'refs/heads/master' && !startsWith(github.ref, 'refs/heads/rc/') && !startsWith(github.ref, 'refs/heads/pkg/'))
uses: actions/cache@v5
uses: actions/cache@caa296126883cff596d87d8935842f9db880ef25 # v5
with:
path: target
key: ci-${{ runner.os }}-cargo-bench-${{ hashFiles('**/Cargo.lock') }}
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/ci_benchmarks_windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: full
RUSTFLAGS: -D warnings
permissions:
contents: read

jobs:
ci_benchmarks_windows:
name: ci_benchmarks_windows
Expand All @@ -27,10 +30,10 @@ jobs:
Remove-Item -Path "C:\Program Files\dotnet" -Recurse -Force -ErrorAction SilentlyContinue
Remove-Item -Path "C:\Program Files (x86)\Android" -Recurse -Force -ErrorAction SilentlyContinue
Remove-Item -Path "$env:PROGRAMDATA\chocolatey" -Recurse -Force -ErrorAction SilentlyContinue
- uses: actions/checkout@v6
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
- name: Cache cargo target
if: github.event_name == 'pull_request' || (github.event_name == 'push' && github.ref != 'refs/heads/develop' && github.ref != 'refs/heads/master' && !startsWith(github.ref, 'refs/heads/rc/') && !startsWith(github.ref, 'refs/heads/pkg/'))
uses: actions/cache@v5
uses: actions/cache@caa296126883cff596d87d8935842f9db880ef25 # v5
with:
path: target
key: ci-${{ runner.os }}-cargo-bench-${{ hashFiles('**/Cargo.lock') }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
}}
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
- name: Cancel running macOS/Windows CI for the same commit
env:
GITHUB_TOKEN: ${{ github.token }}
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/ci_cargo_deny_ubuntu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: full
RUSTFLAGS: -D warnings
permissions:
contents: read

jobs:
ci_cargo_deny_ubuntu:
name: ci_cargo_deny_ubuntu
Expand All @@ -28,16 +31,16 @@ jobs:
sudo rm -rf /opt/ghc
sudo rm -rf /opt/hostedtoolcache/CodeQL
sudo docker image prune --all --force
- uses: actions/checkout@v6
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
- name: Cache cargo target
if: github.event_name == 'pull_request' || (github.event_name == 'push' && github.ref != 'refs/heads/develop' && github.ref != 'refs/heads/master' && !startsWith(github.ref, 'refs/heads/rc/') && !startsWith(github.ref, 'refs/heads/pkg/'))
uses: actions/cache@v5
uses: actions/cache@caa296126883cff596d87d8935842f9db880ef25 # v5
with:
path: target
key: ci-${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
ci-${{ runner.os }}-cargo-
- uses: dtolnay/rust-toolchain@master
- uses: dtolnay/rust-toolchain@df2a88e9fe4098bad09cb42c3dec7187f15861fc # master
with:
toolchain: 1.95.0
- run: sudo apt-get update && sudo apt-get install -y libssl-dev pkg-config libclang-dev build-essential
Expand Down
Loading
Loading