refactor: split config into multiple modules #1081
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: PR Checks | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
types: [opened, synchronize, reopened] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
shell: bash | |
env: | |
SCCACHE_GHA_ENABLED: "on" | |
container: ghcr.io/xline-kv/build-env:latest | |
strategy: | |
fail-fast: true | |
matrix: | |
config: | |
- { | |
name: "Normal", | |
args: "", | |
rustflags: "", | |
test: "llvm-cov nextest --all-features --workspace --codecov --output-path codecov.info", | |
} | |
- { | |
name: "Madsim", | |
args: "--package=simulation", | |
rustflags: "--cfg madsim", | |
test: "nextest run --package=simulation", | |
} | |
name: Tests ${{ matrix.config.name }} | |
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: Trailing spaces check | |
run: ci/scripts/check-trailing-spaces.sh | |
- name: Audit | |
run: cargo audit | |
- name: Format | |
run: cargo fmt --all -- --check | |
- name: Sort crates | |
run: cargo sort --check --workspace | |
- name: Check dependencies | |
run: cargo machete crates/ | |
- name: Workspace hack check | |
run: cargo hakari generate --diff && cargo hakari manage-deps --dry-run && cargo hakari verify | |
- run: sccache --zero-stats > /dev/null | |
- name: Clippy ${{ matrix.config.name }} | |
env: | |
RUSTFLAGS: ${{ matrix.config.rustflags }} | |
run: cargo clippy ${{ matrix.config.args }} --all-targets --all-features -- -D warnings | |
- name: Sccache stats ${{ matrix.config.name }} | |
run: sccache --show-stats && sccache --zero-stats > /dev/null | |
- name: Test ${{ matrix.config.name }} | |
env: | |
RUSTFLAGS: ${{ matrix.config.rustflags }} | |
run: cargo ${{ matrix.config.test }} | |
- name: Sccache stats ${{ matrix.config.name }} | |
run: sccache --show-stats | |
- name: Upload coverage to Codecov | |
if: matrix.config.name == 'Normal' | |
uses: codecov/codecov-action@v4 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: codecov.info | |
verbose: true | |
commit: | |
name: Commit Message Validation | |
if: github.event_name == 'pull_request' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- run: git show-ref | |
- uses: actions-rs/[email protected] | |
with: | |
crate: git-cz | |
version: latest | |
- name: Validate commit messages | |
run: git-cz check ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }} | |
spell-check: | |
name: Spell Check | |
if: github.event_name == 'pull_request' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Check Spelling | |
uses: crate-ci/[email protected] | |
build: | |
name: Build | |
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: Build xline image | |
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 --bin validation_lock_client | |
sudo apt-get install -y --force-yes expect | |
cd scripts | |
cp ../target/release/{xline,benchmark,validation_lock_client} . | |
ldd ./xline | |
ldd ./benchmark | |
cp ../fixtures/{private,public}.pem . | |
docker build . -t ghcr.io/xline-kv/xline:master | |
cd .. | |
pwd | |
mkdir -p _output | |
docker save -o _output/xline.tar ghcr.io/xline-kv/xline:master | |
ls _output | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: xline | |
path: _output/xline.tar | |
e2e: | |
name: E2E kube | |
runs-on: ubuntu-latest | |
needs: | |
- build | |
strategy: | |
fail-fast: false | |
matrix: | |
k8s: | |
- v1.27.3 | |
- v1.28.7 | |
- v1.29.2 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v4 | |
with: | |
name: xline | |
- name: Build kind node image with xline | |
run: | | |
docker build . -f ci/artifacts/kind-node-xline.Dockerfile -t ghcr.io/xline-kv/kind-node-xline:${{ matrix.k8s }}-master --build-arg K8S_VERSION=${{ matrix.k8s }} | |
- name: Create kubernetes cluster with kind | |
env: | |
K8S_VERSION: ${{ matrix.k8s }} | |
run: | | |
./ci/scripts/kind.sh | |
- name: Get cluster status | |
run: | | |
kubectl run test --image httpd:2 | |
kubectl wait --timeout=1m --for=condition=ready pods test | |
kubectl get pods -A -owide | |
- name: Export logs | |
if: failure() | |
run: | | |
mkdir -p _artifacts | |
docker ps | |
kind export logs --loglevel=debug ./_artifacts/logs | |
ls _artifacts | |
- name: Upload logs | |
if: failure() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: xline-kind-log-${{ matrix.k8s }}-${{ github.run_id }} | |
path: ./_artifacts/logs |