Skip to content
Snippets Groups Projects
Commit e5d27007 authored by Éloïs's avatar Éloïs
Browse files

Merge branch 'feature/auto-install-rust' into 'dev'

auto install rust

See merge request nodes/typescript/duniter!1315
parents 35f1da44 fab837b9
Branches
Tags
1 merge request!1315auto install rust
...@@ -31,10 +31,7 @@ workflow: ...@@ -31,10 +31,7 @@ workflow:
- . "$NVM_DIR/nvm.sh" - . "$NVM_DIR/nvm.sh"
- nvm install 10 - nvm install 10
- nvm use 10 - nvm use 10
- curl https://sh.rustup.rs -sSf | sh -s -- -y
- export PATH="$HOME/.cargo/bin:$PATH"
- export RUSTFLAGS="-D warnings" - export RUSTFLAGS="-D warnings"
- rustup show && rustc --version && cargo --version
.cached_nvm: &cached_nvm .cached_nvm: &cached_nvm
...@@ -89,6 +86,7 @@ tests: ...@@ -89,6 +86,7 @@ tests:
stage: tests stage: tests
script: script:
- npm i - npm i
- npm run format:check
- npm test - npm test
# Push coverage to GitLab pages # Push coverage to GitLab pages
- tar cvzf coverage.tar.gz coverage/ - tar cvzf coverage.tar.gz coverage/
...@@ -109,6 +107,8 @@ fmt_and_clippy: ...@@ -109,6 +107,8 @@ fmt_and_clippy:
- when: on_success - when: on_success
stage: quality stage: quality
script: script:
- curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
- export PATH="$HOME/.cargo/bin:$PATH"
- cargo fmt -- --version - cargo fmt -- --version
- cargo fmt -- --check - cargo fmt -- --check
- cargo clippy -- -V - cargo clippy -- -V
......
...@@ -265,7 +265,13 @@ export class MultimeterWatcher implements Watcher { ...@@ -265,7 +265,13 @@ export class MultimeterWatcher implements Watcher {
if (duration) { if (duration) {
const durationSecs = Math.floor(duration / 1000); const durationSecs = Math.floor(duration / 1000);
const durationMillisRemain = duration % 1000; const durationMillisRemain = duration % 1000;
this.multi.write("\nAll done in " + durationSecs + "." + durationMillisRemain + " seconds.\n"); this.multi.write(
"\nAll done in " +
durationSecs +
"." +
durationMillisRemain +
" seconds.\n"
);
} else { } else {
this.multi.write("\nAll done.\n"); this.multi.write("\nAll done.\n");
} }
......
#!/bin/sh
if [ "${1}" = "check" ]
then
$HOME/.cargo/bin/cargo fmt -- --check && prettier --list-different "app/**/*.{ts,json}"
elif [ "${1}" = "all" ]
then
$HOME/.cargo/bin/cargo fmt && prettier --write "app/**/*.{ts,json}"
else
echo "first argument must be \"check\" or \"all\"."
fi
...@@ -2,6 +2,23 @@ ...@@ -2,6 +2,23 @@
cd neon cd neon
if [ -z "${DUNITER_FAST_BUILD}" ]
then
if [ -e "${HOME}/.cargo/bin/rustup" ]
then
rustup update stable
else
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
export PATH="$HOME/.cargo/bin:$PATH"
fi
rustup show
rustc --version
cargo --version
else
echo "WARNING: you have disabled the automatic update of Rust, remember to update Rust regularly with command \"rustup update\"."
fi
if [ "${NEON_BUILD_RELEASE}" = "true" ] || [ "${NODE_ENV}" = "production" ] if [ "${NEON_BUILD_RELEASE}" = "true" ] || [ "${NODE_ENV}" = "production" ]
then then
neon build --release neon build --release
......
...@@ -28,16 +28,16 @@ ...@@ -28,16 +28,16 @@
"tsc": "tsc", "tsc": "tsc",
"tscw": "tsc -w", "tscw": "tsc -w",
"doc": "typedoc --out typedoc/ index.ts app/ --mode file --readme README.md --includeDeclarations --sourcefile-url-prefix \"https://git.duniter.org/nodes/typescript/duniter/blob/loki/\"", "doc": "typedoc --out typedoc/ index.ts app/ --mode file --readme README.md --includeDeclarations --sourcefile-url-prefix \"https://git.duniter.org/nodes/typescript/duniter/blob/loki/\"",
"test": "cargo test --all && nyc --reporter html mocha", "test": "./test/run.sh",
"test:rs": "cargo test --all", "test:rs": "./test/run.sh rs",
"test:ts": "nyc --reporter html mocha", "test:ts": "./test/run.sh ts",
"start": "node bin/duniter start", "start": "node bin/duniter start",
"build": "./neon/build.sh && cd.. && tsc && cd \"../node_modules/duniter-ui\" && npm install && npm run build", "build": "./neon/build.sh && cd.. && tsc && cd \"../node_modules/duniter-ui\" && npm install && npm run build",
"install": "./neon/build.sh", "install": "./neon/build.sh",
"lint": "lint-staged", "lint": "lint-staged",
"prettier": "prettier --write app/**/*/*.ts", "prettier": "prettier --write app/**/*/*.ts",
"format:check": "prettier --list-different \"app/**/*.{ts,json}\"", "format:check": "./format.sh check",
"format:all": "prettier --write \"app/**/*.{ts,json}\"" "format:all": "./format.sh all"
}, },
"nyc": { "nyc": {
"require": [ "require": [
......
#!/bin/sh
if [ "${1}" = "rs" ]
then
$HOME/.cargo/bin/cargo test --all
elif [ "${1}" = "ts" ]
then
nyc --reporter html mocha
else
$HOME/.cargo/bin/cargo test --all && nyc --reporter html mocha
fi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment