Crates.io | zuu |
lib.rs | zuu |
version | 24.0.0-alpha.1 |
source | src |
created_at | 2023-02-15 07:36:22.533528 |
updated_at | 2024-10-29 11:25:09.987579 |
description | A program to check your code quality before all commit |
homepage | |
repository | https://github.com/otechdo/zuu |
max_upload_size | |
id | 785597 |
size | 225,258 |
Zuu is a continuous verification tool for multiple programming languages.
It allows you to run tests, check code formatting, perform security audits, and more, based on the configured programming language.
features
.Clone the repository to your machine:
git clone https://github.com/otechdo/zuu.git
cd zuu
Running with Docker Compose
To run the project in an isolated Docker environment, use Docker Compose.
You can run tests for each supported language.
To start a test container for a specific language, use the following command:
docker-compose up --build --abort-on-container-exit <service-name>
For example, to run the tests for Rust:
docker-compose up --build --abort-on-container-exit rust-tests
Running Tests for All Languages
You can also run all the tests sequentially for every supported language:
docker-compose up --build --abort-on-container-exit
If you're working locally with Rust and want to compile the project with a specific language feature, use Cargo features
. For example, to activate the feature for Rust:
cargo build --no-default-features --features "rust"
Zuu provides several options that you can control via environment variables to customize the checks it performs. The configuration options allow you to enable or disable specific tasks such as testing, linting, formatting checks, security audits, and license validation.
Environment Variable | Description | Default |
---|---|---|
TESTS |
Enable or disable the execution of tests. | false |
FORMAT |
Check if the code is properly formatted. | false |
LINT |
Run a linting process to catch potential issues. | false |
AUDIT |
Perform a security audit of the dependencies. | false |
LICENSE |
Check the license compatibility of dependencies. | false |
These options are controlled using environment variables, which you can set when running the project in either your development or Docker environment. By default, all options are disabled (false
), but you can enable them as needed by setting them to true
.
When running locally, you can set these environment variables in your shell before executing the Zuu tool:
export TESTS=true # Enable test execution
export FORMAT=true # Enable code formatting checks
export LINT=true # Enable linting
export AUDIT=true # Enable security audit
export LICENSE=true # Enable license checks
# Run the tool after setting the environment variables
cargo run
In the docker-compose.yml
file, you can define these options under the environment
section for your service. For example:
services:
zuu:
image: otechdo/zuu:latest
environment:
- TESTS=true
- FORMAT=true
- LINT=true
- AUDIT=true
- LICENSE=true
- EDITOR=vim
volumes:
- .:/app # Copy source code in the container
command:
- rust-audit # Check rust code
This will run Zuu with all the options enabled.
You can adjust these options in Docker by modifying the environment variables in your docker-compose.yml
or when running the Docker container.
For example:
docker run -e TESTS=true -e FORMAT=true -e LINT=false -e AUDIT=true -e LICENSE=true your-docker-image
Follow these steps to customise the project, edit the Dockerfiles, and push the images to your own Docker repository:
Clone the repository to your machine:
git clone https://github.com/otechdo/zuu.git
cd zuu/dockers
Ensure Docker and Docker Compose are installed on your system:
Edit the Dockerfiles according to your needs:
rust/Dockerfile
, python/Dockerfile
).Login to Docker Hub:
docker login
Build and push your images:
make -j 4 USERNAME="your_docker_username" REPO="your_repository_name"
Verify your images on Docker Hub:
You can use both GitHub Actions and Travis CI for continuous integration (CI) to automate the build and testing process for the project.
.github/workflows/ci.yml
file in your repository with the following configuration:name: zuu
on:
push:
branches:
- main
- develop
pull_request:
branches:
- main
- develop
env:
CARGO_TERM_COLOR: always
TERM: xterm-256color
jobs:
zuu:
strategy:
matrix:
os: [ ubuntu-latest, ubuntu-22.04, ubuntu-20.04, macos-latest, macos-13, macos-12 ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
- name: deps
run: cargo install cargo-audit cargo-auditable cargo-deny cargo-outdated
- name: installation
run: cargo install zuu --no-default-features --features rust
- name: zuu
run: git checkout "${GITHUB_REF##*/}" && zuu
DOCKER_USERNAME
and DOCKER_PASSWORD
with your Docker Hub credentials.With this configuration, GitHub Actions will build and test your Docker images on every push or pull request to the main
branch.
.travis.yml
file in your repository:language: minimal
services:
- docker
before_script:
- docker-compose --version
- docker-compose up --build --abort-on-container-exit
script:
- docker-compose run <your_test_service>
deploy:
provider: script
script: docker-compose push
on:
branch: main
env:
global:
- DOCKER_USERNAME=$DOCKER_USERNAME
- DOCKER_PASSWORD=$DOCKER_PASSWORD
DOCKER_USERNAME
and DOCKER_PASSWORD
as environment variables.This Travis CI configuration will build and test the Docker images, and push them to Docker Hub when the main
branch is updated.
Contributions are welcome! To contribute to the project, follow these steps:
git commit -m 'Add some amazing feature'
).git push origin feature/amazing-feature
).This project is licensed under the AGPL-3.0 License. See the LICENSE file for more details.
{
"scripts": {
"check-structure": "echo 'Check project structure'", // Vous pouvez personnaliser cette commande
"test": "jest", // Ou "mocha" ou tout autre framework de test
"format:check": "prettier --check .", // Utilisation de Prettier pour le formatage
"generate-docs": "jsdoc -c jsdoc.conf.json", // Génération de documentation avec JSDoc
"lint": "eslint .", // Utilisation d'ESLint pour la vérification du style
"audit": "npm audit" // Vérification des vulnérabilités
}
}