Skip to content

Commit

Permalink
ci: optimize ci
Browse files Browse the repository at this point in the history
Signed-off-by: iGxnon <[email protected]>
  • Loading branch information
iGxnon committed Nov 30, 2023
1 parent b432ce6 commit dbb7812
Show file tree
Hide file tree
Showing 10 changed files with 254 additions and 310 deletions.
31 changes: 18 additions & 13 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,33 @@ jobs:
name: benchmark
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
submodules: recursive
- run: sudo bash ./.github/scripts/install_deps.sh
- uses: actions-rs/toolchain@v1
with:
profile: default
toolchain: ${{ env.CI_RUST_TOOLCHAIN }}
override: true
- uses: Swatinem/rust-cache@v2
with:
shared-key: "xline"
- uses: actions-rs/cargo@v1

- name: Configure sccache
uses: actions/github-script@v6
with:
command: build
args: --release
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 -it --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
Expand Down
29 changes: 0 additions & 29 deletions .github/workflows/cache_clean.yml

This file was deleted.

179 changes: 0 additions & 179 deletions .github/workflows/ci.yml

This file was deleted.

37 changes: 0 additions & 37 deletions .github/workflows/coverage.yml

This file was deleted.

42 changes: 42 additions & 0 deletions .github/workflows/merge_queue.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Queue Checks

on:
merge_group:
types: [checks_requested]

jobs:
checks:
# NOTICE: It should keep the same name with `jobs.checks` in `pull_request.yml`
# Refer: https://twitter.com/igxnon/status/1728889064571682883
name: Checks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Configure sccache
uses: actions/github-script@v6
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 -it --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} .
ldd ./xline
ldd ./benchmark
cp ../xline-test-utils/{private,public}.pem .
docker build . -t ghcr.io/xline-kv/xline:latest
docker pull gcr.io/etcd-development/etcd:v3.5.5
bash ./validation_test.sh
Loading

0 comments on commit dbb7812

Please sign in to comment.