build: added git tasks to Makefile

This commit is contained in:
Andrew Rioux 2023-05-07 00:39:22 -04:00
parent 52e458296c
commit 813dc104e8
Signed by: andrew.rioux
GPG Key ID: 9B8BAC47C17ABB94
5 changed files with 49 additions and 16 deletions

View File

@ -20,7 +20,9 @@ ARG USERNAME=vscode
ENV DEBIAN_FRONTEND=noninteractive \ ENV DEBIAN_FRONTEND=noninteractive \
RUSTUP_HOME=/usr/local/rustup \ RUSTUP_HOME=/usr/local/rustup \
CARGO_HOME=/usr/local/cargo \ CARGO_HOME=/usr/local/cargo \
PATH=/usr/local/cargo/bin:$PATH:/home/vscode/.cargo/bin PATH=/usr/local/cargo/bin:$PATH:/home/vscode/.cargo/bin \
EDITOR='code -w' \
VISUAL='code -w'
RUN apt-get update && \ RUN apt-get update && \
apt install -y cmake git libtool valgrind docker-compose lldb sudo zsh wget && \ apt install -y cmake git libtool valgrind docker-compose lldb sudo zsh wget && \

View File

@ -7,15 +7,46 @@ skip_core_tasks = true
[tasks.default] [tasks.default]
dependencies = ["build"] dependencies = ["build"]
[tasks.check]
workspace = false
command = "docker-compose"
args = ["run", "build", "check", "${@}"]
[tasks.build] [tasks.build]
workspace = false workspace = false
command = "docker-compose" command = "docker-compose"
args = ["run", "build", "${@}"] args = ["run", "build", "build", "${@}"]
[tasks.fmt] [tasks.fmt]
command = "cargo" command = "cargo"
args = ["fmt"] args = ["fmt"]
[tasks.test]
workspace = false
command = "docker-compose"
args = ["run", "build", "test", "${@}"]
#-----------------------
#
# Git tasks
#
#-----------------------
[tasks.git-pre-commit]
workspace = false
dependencies = ["build", "test", "fmt"]
[tasks.git-add]
workspace = false
command = "git"
args = ["add", "."]
[tasks.git-commit]
workspace = false
command = "convco"
args = ["commit", "-i"]
dependencies = ["git-pre-commit", "git-add"]
#--------------------------------- #---------------------------------
# #
# Project setup tasks # Project setup tasks
@ -24,13 +55,13 @@ args = ["fmt"]
[tasks.setup] [tasks.setup]
workspace = false workspace = false
dependencies = ["pull-rust-image", "update-submodules"] dependencies = ["setup-pull-rust-image", "setup-update-submodules"]
[tasks.pull-rust-image] [tasks.setup-pull-rust-image]
workspace = false workspace = false
script = "docker pull rust:1-alpine" script = "docker pull rust:1-alpine"
[tasks.update-submodules] [tasks.setup-update-submodules]
workspace = false workspace = false
script = "git submodule update --init" script = "git submodule update --init"
@ -42,8 +73,8 @@ script = "git submodule update --init"
[tasks.ci] [tasks.ci]
workspace = false workspace = false
dependencies = ["setup", "build"] dependencies = ["setup", "build", "ci-convco-check"]
[tasks.convco-check] [tasks.ci-convco-check]
command = "convco" command = "convco"
args = ["check"] args = ["check"]

View File

@ -8,7 +8,7 @@ services:
- ${CARGO_HOME}/registry:${CARGO_HOME}/registry - ${CARGO_HOME}/registry:${CARGO_HOME}/registry
- ${PWD}:/sparse - ${PWD}:/sparse
working_dir: /sparse working_dir: /sparse
entrypoint: "/usr/local/cargo/bin/cargo build" entrypoint: /usr/local/cargo/bin/cargo
tty: true tty: true
examples_bindshell_target: examples_bindshell_target: