|
|
|
|
@ -19,11 +19,27 @@ flatpak-checks:
|
|
|
|
|
tags: |
|
|
|
|
- flatpak |
|
|
|
|
interruptible: true |
|
|
|
|
variables: |
|
|
|
|
CARGO_CODECLIMATE_DOWNLOAD_URL: "https://gitlab.com/woshilapin/cargo-sonar/-/releases/1.3.1/downloads/bin/x86_64-unknown-linux-musl/cargo-codeclimate" |
|
|
|
|
CARGO_CODECLIMATE_SHA256SUM: "401d1cf22d2f1b6f1986b479517c31e0544e8b7ecbb70f30e684ca7c171a0f17" |
|
|
|
|
script: |
|
|
|
|
# Initialize the Flatpak sandbox. |
|
|
|
|
- flatpak-builder --keep-build-dirs --user --disable-rofiles-fuse --stop-at=${FLATPAK_MODULE} flatpak_app --repo=repo ${BRANCH:+--default-branch=$BRANCH} ${MANIFEST_PATH} |
|
|
|
|
# Lint the Rust code |
|
|
|
|
- echo "cargo clippy -- -D warnings" | flatpak-builder --disable-rofiles-fuse --build-shell=${FLATPAK_MODULE} flatpak_app ${MANIFEST_PATH} |
|
|
|
|
# Lint the Blueprint files |
|
|
|
|
# Lint the Rust code with clippy. |
|
|
|
|
- echo "cargo clippy --message-format=json -- -D warnings > clippy-report.json " | flatpak-builder --disable-rofiles-fuse --build-shell=${FLATPAK_MODULE} flatpak_app ${MANIFEST_PATH} |
|
|
|
|
# Lint the Blueprint files. |
|
|
|
|
- echo "blueprint-compiler format ../src" | flatpak-builder --disable-rofiles-fuse --build-shell=${FLATPAK_MODULE} flatpak_app ${MANIFEST_PATH} |
|
|
|
|
# Lint the Meson files |
|
|
|
|
# Lint the Meson files. |
|
|
|
|
- echo "meson format -qr .." | flatpak-builder --disable-rofiles-fuse --build-shell=${FLATPAK_MODULE} flatpak_app ${MANIFEST_PATH} |
|
|
|
|
- ls -la . |
|
|
|
|
after_script: |
|
|
|
|
# Download cargo-codeclimate |
|
|
|
|
- curl -L -o cargo-codeclimate ${CARGO_CODECLIMATE_DOWNLOAD_URL} |
|
|
|
|
- echo "${CARGO_CODECLIMATE_SHA256SUM} cargo-codeclimate" > cargo-codeclimate.sha256sum |
|
|
|
|
- sha256sum -c cargo-codeclimate.sha256sum |
|
|
|
|
- chmod +x cargo-codeclimate |
|
|
|
|
# Convert the clippy report to CodeClimate / GitLab Code Quality format. |
|
|
|
|
- ./cargo-codeclimate --clippy --clippy-path .flatpak-builder/build/${FLATPAK_MODULE}/_flatpak_build/clippy-report.json |
|
|
|
|
artifacts: |
|
|
|
|
reports: |
|
|
|
|
codequality: codeclimate.json |
|
|
|
|
|