Skip to content

Commit

Permalink
Merge branch 'master' into Instrument-await-using-await-tree
Browse files Browse the repository at this point in the history
  • Loading branch information
Harsh1s authored May 12, 2024
2 parents 16ae376 + 6713407 commit 86ea780
Show file tree
Hide file tree
Showing 168 changed files with 7,260 additions and 2,161 deletions.
2 changes: 1 addition & 1 deletion .config/nextest.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[profile.default]
retries = 0
slow-timeout = { period = "10s" }
slow-timeout = { period = "10s", terminate-after = 3 }
status-level = "all"
final-status-level = "slow"
18 changes: 18 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
# Check for updates to GitHub Actions every day
interval: "daily"
# Allow up to 10 open pull requests for update github-actions
# 5 by default
# see https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#open-pull-requests-limit
open-pull-requests-limit: 10
- package-ecosystem: "cargo"
directory: "/"
schedule:
interval: "weekly"
labels:
- "dependencies"
open-pull-requests-limit: 10
36 changes: 14 additions & 22 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- cron: "00 00 * * 1"

env:
CI_RUST_TOOLCHAIN: 1.71.0
CI_RUST_TOOLCHAIN: 1.74.0

jobs:
benchmark:
Expand All @@ -18,29 +18,21 @@ jobs:
submodules: recursive

- name: Configure sccache
uses: actions/github-script@v6
uses: actions/github-script@v7
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- name: Build xline
run: |
docker run -q --rm -v $(pwd):/xline \
-e SCCACHE_GHA_ENABLED=on \
-e ACTIONS_CACHE_URL=${ACTIONS_CACHE_URL} \
-e ACTIONS_RUNTIME_TOKEN=${ACTIONS_RUNTIME_TOKEN} \
ghcr.io/xline-kv/build-env:latest \
cargo build --release --bin xline --bin benchmark
- run: |
cd scripts
cp ../target/release/{xline,benchmark} .
docker build . -t ghcr.io/xline-kv/xline:latest
docker pull datenlord/etcd:v3.5.5
bash ./benchmark.sh
- uses: actions/upload-artifact@v1
with:
name: benchmark-output
path: scripts/out
call_build_xline:
name: Build and Upload Artifacts
uses: ./.github/workflows/build_xline.yml
with:
docker_xline_image: "ghcr.io/xline-kv/build-env:latest"
binaries: "xline,benchmark"
additional_setup_commands: |
docker build . -t ghcr.io/xline-kv/xline:latest
docker pull datenlord/etcd:v3.5.5
script_name: "benchmark.sh"
uploadLogs: false
uploadBenchmark: true
85 changes: 85 additions & 0 deletions .github/workflows/build_xline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: Build Xline
env:
CI_RUST_TOOLCHAIN: 1.74.0
on:
workflow_call:
inputs:
additional_setup_commands:
description: "Additional commands to run after initial setup, before running the script"
required: false
default: ""
type: string
docker_xline_image:
description: "Docker image to use for building"
required: true
type: string
binaries:
description: "Comma-separated list of binaries"
required: true
type: string
script_name:
description: "Name of the script to run"
required: true
type: string
uploadLogs:
description: "Boolean to decide if logs should be uploaded"
required: false
default: false
type: boolean
uploadBenchmark:
description: "Boolean to decide if benchmark output should be uploaded"
required: false
default: false
type: boolean
jobs:
build_and_test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Configure sccache
uses: actions/github-script@v7
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- name: Prepare release binaries
id: prepare_binaries
run: |
IFS=',' read -ra binary_array <<< "${{ inputs.binaries }}"
release_bin=""
for binary in "${binary_array[@]}"; do
release_bin+="--bin $binary "
done
release_bin="${release_bin::-1}"
echo "::set-output name=release_bin::$release_bin"
- name: Build xline
run: |
docker run -q --rm -v $(pwd):/xline \
-e SCCACHE_GHA_ENABLED=on \
-e ACTIONS_CACHE_URL=${ACTIONS_CACHE_URL} \
-e ACTIONS_RUNTIME_TOKEN=${ACTIONS_RUNTIME_TOKEN} \
${{ inputs.docker_xline_image }} \
cargo build --release ${{ steps.prepare_binaries.outputs.release_bin }}
- run: |
cd scripts
cp ../target/release/{${{ inputs.binaries }}} .
${{ inputs.additional_setup_commands }}
bash ./${{ inputs.script_name }}
- name: Upload logs
if: ${{ inputs.uploadLogs }} && (failure() || cancelled())
uses: actions/upload-artifact@v4
with:
name: Xline logs
path: scripts/logs

- name: Upload benchmark output
if: ${{ inputs.uploadBenchmark }}
uses: actions/upload-artifact@v4
with:
name: benchmark-output
path: scripts/out
26 changes: 17 additions & 9 deletions .github/workflows/docker_image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@ name: Push Docker Image

on:
workflow_dispatch: { }
push:
branches:
- master

env:
CI_RUST_TOOLCHAIN: 1.71.0
CI_RUST_TOOLCHAIN: 1.74.0
IMAGE_ID: ghcr.io/xline-kv/xline

jobs:
Expand All @@ -27,19 +30,24 @@ jobs:
cross_image: aarch64-linux-gnu
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: recursive

- name: Generate App Version
id: generate_app_version
run: echo app_version=`git describe --tags --always` >> $GITHUB_OUTPUT
run: |
if [ ${{ github.event_name }} = "push" ];then
echo app_version=latest >> $GITHUB_OUTPUT
else
echo app_version=`git describe --tags --always` >> $GITHUB_OUTPUT
fi
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v3

- name: Setup Custom Image for ${{ matrix.job.cross_image }}
uses: docker/build-push-action@v2
uses: docker/build-push-action@v5
with:
context: ci/cross
file: ci/cross/Dockerfile.${{ matrix.job.target }}
Expand Down Expand Up @@ -68,18 +76,18 @@ jobs:
mv ./target/${{ matrix.job.target }}/release/benchmark ./scripts
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@v3

- name: Login to GHCR
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ghcr.io
username: xline-kv
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build Docker Image
id: build_image
uses: docker/build-push-action@v4
uses: docker/build-push-action@v5
with:
context: ./scripts
platforms: ${{ matrix.job.platform }}
Expand All @@ -92,7 +100,7 @@ jobs:
touch "/tmp/digests/${digest#sha256:}"
- name: Upload Digest
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: digests
path: /tmp/digests/*
Expand Down
47 changes: 47 additions & 0 deletions .github/workflows/issue-cmds.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
on:
issue_comment:
types:
- created

jobs:
assignme:
name: /assignme
runs-on: ubuntu-latest
if: startsWith(github.event.comment.body, '/assignme')

steps:
- uses: xt0rted/slash-command-action@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
command: assignme
reaction: "true"
reaction-type: "rocket"
permission-level: read

- uses: actions-ecosystem/action-add-assignees@v1
with:
github_token: ${{ secrets.github_token }}
assignees: ${{ github.actor }}

contributing-agreement:
name: /contributing-agreement
runs-on: ubuntu-latest
if: startsWith(github.event.comment.body, '/contributing-agreement')

steps:
- uses: xt0rted/slash-command-action@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
command: contributing-agreement
reaction: "true"
reaction-type: "rocket"
permission-level: read

- uses: peter-evans/create-or-update-comment@v4
with:
issue-number: ${{ github.event.issue.number }}
body: |
Contributing Agreements:
- [pull request](https://github.com/xline-kv/Xline/blob/master/CONTRIBUTING.md#pull-requests)
- [merge policy](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/incorporating-changes-from-a-pull-request/about-pull-request-merges#rebase-and-merge-your-commits)
21 changes: 21 additions & 0 deletions .github/workflows/issue-welcome.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
on:
issues:
types:
- opened

# https://github.com/marketplace/actions/create-or-update-comment

jobs:
welcome:
runs-on: ubuntu-latest
steps:
- uses: peter-evans/create-or-update-comment@v4
with:
issue-number: ${{ github.event.issue.number }}
body: |
👋 Thanks for opening this issue!
Reply with the following command on its own line to get help or engage:
- `/contributing-agreement` : to print Contributing Agreements.
- `/assignme` : to assign this issue to you.
6 changes: 3 additions & 3 deletions .github/workflows/merge_image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@ jobs:
name: Merge Docker Image
steps:
- name: Download Digests
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: digests
path: /tmp/digests

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3

- name: Login to GHCR
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ghcr.io
username: xline-kv
Expand Down
Loading

0 comments on commit 86ea780

Please sign in to comment.