diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 33cbbc269d2bb8c4dae8f5cf13074b8e25c81e95..46e9d7c89e50887a63b0d9ff5e738adb51f3ef1a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -24,7 +24,7 @@ workflow: - server.ts - yarn.lock -.nvm_env: &nvm_env +.env: &env image: registry.duniter.org/docker/duniter-ci:v0.0.4 tags: - redshift @@ -35,9 +35,12 @@ workflow: - nvm use 10.19.0 - 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 - <<: *nvm_env + <<: *env cache: untracked: true paths: @@ -49,11 +52,11 @@ workflow: - redshift before_script: - export PATH="$HOME/.cargo/bin:$PATH" - - rustup show - - rustc --version && cargo --version + - rustup show && rustc --version && cargo --version + #pages: -# <<: *nvm_env +# <<: *env # stage: pages # cache: {} # script: @@ -76,27 +79,8 @@ workflow: # - loki # - dev -tests:rs: - extends: .nvm_env - rules: - - if: $CI_COMMIT_TAG - when: never - - if: $CI_MERGE_REQUEST_ID - when: manual - - when: on_success - stage: tests - script: - - cargo fmt -- --version - - cargo fmt -- --check - - RUSTFLAGS="-D warnings" cargo build - - cargo test --all - # Coverage (doesn't make sense yet) - #- cargo test --doc - #- cargo tarpaulin --ignore-tests -iv --out Xml - #- bash <(curl -s https://codecov.io/bash) - -tests:ts: - <<: *nvm_env +tests: + <<: *env rules: - if: $CI_COMMIT_TAG when: never @@ -117,15 +101,17 @@ tests:ts: - coverage.tar.gz expire_in: 4h -clippy: - extends: .nvm_env +fmt_and_clippy: + extends: .env rules: - if: $CI_COMMIT_TAG when: never - if: $CI_MERGE_REQUEST_ID - - when: manual + - when: on_success stage: quality script: + - cargo fmt -- --version + - cargo fmt -- --check - cargo clippy -- -V - cargo clippy --all --tests -- -D warnings --verbose @@ -145,7 +131,7 @@ audit_dependencies: - when: manual sync_g1: - <<: *nvm_env + <<: *env <<: *integration_rules stage: integration script: @@ -153,7 +139,7 @@ sync_g1: - bash .gitlab/test/check_g1_sync.sh sync_gtest: - <<: *nvm_env + <<: *env <<: *integration_rules stage: integration script: diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index a3f3862e0e3586fec203e2daa1561f787c4051a5..0000000000000000000000000000000000000000 --- a/.travis.yml +++ /dev/null @@ -1,36 +0,0 @@ -# Nodejs software -language: node_js - -node_js: - - 8.9.2 -env: - - CXX=g++-4.8 -addons: - apt: - sources: - - ubuntu-toolchain-r-test - packages: - - g++-4.8 -code_climate: - repo_token: 67f8f00d5cf9e5c46b7644aebee5ac9df9d6ee267014a6f61a7a7b1048357a1c - -sudo: false -dist: precise - -# Unit Tests (+code coverage) -script: npm run-script test-travis - -after_success: - # Send coverage data to Coveralls - - cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js - - rm -Rf ./coverage - -deploy: - - provider: npm - email: cem.moreau@gmail.com - skip_cleanup: true - api_key: - secure: gZV7yLxDwwxD4oQXl1hwugmtnWXqP8vojuVGtAGwtMlwJE0n270w6O5xZHDd7DSmOZLftk6/wue/RdhLDsD6J1z3Uxu+VoUWy7aG/sFcGRaBwct+bGqFGkyd+I1mCXFnAZMDwbtgdkQlOCS9PM1BfMEYq49XXqaLaDnwouR+2bI= - on: - tags: true - repo: duniter/duniter diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 1a271d5e4c01d8f303faad4f390484c16c87b2eb..0000000000000000000000000000000000000000 --- a/appveyor.yml +++ /dev/null @@ -1,17 +0,0 @@ -environment: - matrix: - - nodejs_version: "8.9.2" - ADDON_VERSION: "48" - -platform: - - x64 - -install: - - echo %ADDON_VERSION% - - ps: Update-NodeJsInstallation $env:nodejs_version $env:platform - - node -v - - npm install -g npm - - npm install -g nw-gyp node-pre-gyp - - npm install - -build: off diff --git a/package.json b/package.json index a82970f304ab344f942e5f9ee5e6cb04a11c1ed8..6613400b4c80c37fb6871b01fd1f07b063e5e71e 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,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": "nyc --reporter html mocha", + "test": "cargo test --all && nyc --reporter html mocha", + "test:rs": "cargo test --all", + "test:ts": "nyc --reporter html mocha", "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", @@ -35,8 +37,7 @@ "prettier": "prettier --write app/**/*/*.ts", "reformat": "eslint --cache --fix app/**/*/*.ts", "format:check": "prettier --list-different \"app/**/*.{ts,json}\"", - "format:all": "prettier --write \"app/**/*.{ts,json}\"", - "test-travis": "nyc --reporter lcovonly mocha test/" + "format:all": "prettier --write \"app/**/*.{ts,json}\"" }, "nyc": { "require": [ diff --git a/release/new_version.sh b/release/new_version.sh index fc5120c778830e984aec36d220a6d8771929fffb..b5b1ba41ba0d03abcd718e4e6b7c3cb4641bc641 100755 --- a/release/new_version.sh +++ b/release/new_version.sh @@ -1,15 +1,14 @@ #!/bin/bash ### Releasing -current=`grep -P "version\": \"\d+.\d+.\d+(\w*)" package.json | grep -oP "\d+.\d+.\d+(\w*)"` +current=`grep -P "version\": \"\d+.\d+.\d+(-\w*)" package.json | grep -oP "\d+.\d+.\d+(-\w*)"` echo "Current version: $current" -if [[ $1 =~ ^[0-9]+.[0-9]+.[0-9]+((a|b)[0-9]+)?$ ]]; then +if [[ $1 =~ ^[0-9]+.[0-9]+.[0-9]+(-(alpha|beta|rc)[0-9]*)?$ ]]; then echo "Changing to version: $1" # Change the version in package.json and test file sed -i "s/version\": .*/version\": \"$1\",/g" package.json sed -i "s/Version: .*/Version: $1/g" release/extra/debian/package/DEBIAN/control - sed -i "s/ release: .*/ release: v$1/g" appveyor.yml # Duniter.iss (Windows installer) sed -i "s/define MyAppVerStr.*/define MyAppVerStr \"v$1\"/g" release/arch/windows/duniter.iss