include: - template: Dependency-Scanning.gitlab-ci.yml - template: SAST.gitlab-ci.yml stages: - test - install - package - installer code_quality: stage: test image: docker:stable allow_failure: true services: - docker:stable-dind variables: DOCKER_DRIVER: overlay2 script: - | if ! docker info &>/dev/null; then if [ -z "$DOCKER_HOST" -a "$KUBERNETES_PORT" ]; then export DOCKER_HOST='tcp://localhost:2375' fi fi - docker run --env CODECLIMATE_CODE="$PWD" --volume "$PWD":/code --volume /var/run/docker.sock:/var/run/docker.sock --volume /tmp/cc:/tmp/cc --entrypoint "/bin/sh" codeclimate/codeclimate -c "/usr/src/app/bin/codeclimate engines:install && /usr/src/app/bin/codeclimate analyze" only: - branches@ryzen-controller-team/ryzen-controller - tags@ryzen-controller-team/ryzen-controller except: variables: - $CODE_QUALITY_DISABLED dependency_scanning: stage: test only: - branches@ryzen-controller-team/ryzen-controller except: [] sast: stage: test only: - branches@ryzen-controller-team/ryzen-controller except: [] js_syntax: stage: test only: - branches@ryzen-controller-team/ryzen-controller image: node:carbon tags: [ docker ] cache: {} dependencies: [] before_script: - npm install -g acorn - rm -rf node_modules script: - find . -iname "*.js" -print0 | xargs -0 -I % sh -c 'echo "%"; acorn --ecma6 --silent "%"' node: only: - tags@ryzen-controller-team/ryzen-controller - branches@ryzen-controller-team/ryzen-controller except: - master stage: install tags: [ docker ] image: electronuserland/builder:wine-mono script: - npm install - cp vendor/7z/7z.exe node_modules/electron-winstaller/vendor/7z.exe - cp vendor/7z/7z.dll node_modules/electron-winstaller/vendor/7z.dll cache: paths: - node_modules/ artifacts: paths: - node_modules/ win32: only: - tags@ryzen-controller-team/ryzen-controller - branches@ryzen-controller-team/ryzen-controller except: - master stage: package tags: [ docker ] image: electronuserland/builder:wine-mono script: - rm -rf vendor/* - npm run-script package-win32 artifacts: paths: - release-builds/ dependencies: - node linux: only: - tags@ryzen-controller-team/ryzen-controller - branches@ryzen-controller-team/ryzen-controller except: - master stage: package tags: [ docker ] image: electronuserland/builder:wine-mono script: - rm -rf bin/* - npm run-script package-linux artifacts: paths: - release-builds/ dependencies: - node exe-installer: only: - tags@ryzen-controller-team/ryzen-controller - branches@ryzen-controller-team/ryzen-controller except: - master stage: installer tags: [ docker ] image: docker:stable services: - docker:stable-dind variables: DOCKER_DRIVER: overlay2 script: - | if ! docker info &>/dev/null; then if [ -z "$DOCKER_HOST" -a "$KUBERNETES_PORT" ]; then export DOCKER_HOST='tcp://localhost:2375' fi fi - mkdir installer-builds - chmod 777 installer-builds - docker run --env ELECTRON_CACHE="/root/.cache/electron" --env ELECTRON_BUILDER_CACHE="/root/.cache/electron-builder" -v ${PWD}:/project -v ~/.cache/electron:/root/.cache/electron -v ~/.cache/electron-builder:/root/.cache/electron-builder electronuserland/builder:wine-mono /bin/bash -c "npm run-script build-exe" - ls installer-builds/RyzenControllerInstaller.exe artifacts: paths: - installer-builds/ dependencies: - node - win32 deb-installer: only: - tags@ryzen-controller-team/ryzen-controller - branches@ryzen-controller-team/ryzen-controller except: - master stage: installer tags: [ docker ] image: debian:stretch before_script: - apt update -y - apt install fakeroot curl -y - curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash - export NVM_DIR="$HOME/.nvm" - '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"' - nvm install 10.15.1 - nvm use 10.15.1 script: - npm run-script build-deb artifacts: paths: - installer-builds/ dependencies: - node - linux rpm-installer: only: - tags@ryzen-controller-team/ryzen-controller - branches@ryzen-controller-team/ryzen-controller except: - master stage: installer tags: [ docker ] image: electronuserland/builder:wine-mono script: - npm run-script build-rpm artifacts: paths: - installer-builds/ dependencies: - node - linux