diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a81c571c0c163f2f92d007eaaef448e7e504e672..e960e8643b2d2dcdb7170684ed6c7e32e0bfe3fd 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -31,10 +31,7 @@ workflow: - . "$NVM_DIR/nvm.sh" - nvm install 10 - nvm use 10 - - curl https://sh.rustup.rs -sSf | sh -s -- -y - - export PATH="$HOME/.cargo/bin:$PATH" - export RUSTFLAGS="-D warnings" - - rustup show && rustc --version && cargo --version .cached_nvm: &cached_nvm @@ -109,6 +106,8 @@ fmt_and_clippy: - when: on_success stage: quality 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 -- --check - cargo clippy -- -V diff --git a/neon/build.sh b/neon/build.sh index 105a7a50505a175fd1ea8d587f0f768e4483879a..19c59a84fafd06d3a82cc3293aa8dcc981ef1577 100755 --- a/neon/build.sh +++ b/neon/build.sh @@ -2,6 +2,23 @@ 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" ] then neon build --release diff --git a/package.json b/package.json index 654c92e86ec389e66980f2af21ff2294567434eb..22617b1624c4a2c1122bd9b72b994315da222acb 100644 --- a/package.json +++ b/package.json @@ -28,9 +28,9 @@ "tsc": "tsc", "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/\"", - "test": "cargo test --all && nyc --reporter html mocha", - "test:rs": "cargo test --all", - "test:ts": "nyc --reporter html mocha", + "test": "./test/run.sh", + "test:rs": "./test/run.sh rs", + "test:ts": "./test/run.sh ts", "start": "node bin/duniter start", "build": "./neon/build.sh && cd.. && tsc && cd \"../node_modules/duniter-ui\" && npm install && npm run build", "install": "./neon/build.sh", diff --git a/test/run.sh b/test/run.sh new file mode 100755 index 0000000000000000000000000000000000000000..4f22f777415af6717a372c8936e7a2fc7ceacc82 --- /dev/null +++ b/test/run.sh @@ -0,0 +1,11 @@ +#!/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