-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
72 lines (68 loc) · 2.67 KB
/
.gitlab-ci.yml
File metadata and controls
72 lines (68 loc) · 2.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
stages:
- lint
# - build
# We're using the official swift-format tool for linting, but it crashes :/
# See: https://github.com/swiftlang/swift-format
# Bug Report: https://github.com/swiftlang/swift-format/issues/960
lint_swiftformat:
stage: lint
image: "swift:latest"
script:
# For now, we omit the "--strict" option which would fail the job even for warnings
- swift format lint -r --configuration CellGuardAppSwift/.swift-format.json CellGuardAppSwift/CellGuard
- swift format lint -r --configuration CellGuardAppSwift/.swift-format.json CellGuardAppSwift/CellGuardTests
- swift format lint -r --configuration CellGuardAppSwift/.swift-format.json CellGuardAppSwift/CellGuardUITests
- echo "We only use this linter to check for syntactic errors, please refer to SwiftLint for code style."
# Use community-based SwiftLint project
# See: https://github.com/realm/SwiftLint?tab=readme-ov-file
lint_swiftlint:
stage: lint
image: "ghcr.io/realm/swiftlint:0.59.1"
script:
- swiftlint --config CellGuardAppSwift/.swiftlint.yml --reporter codeclimate --output swift-lint.json CellGuardAppSwift
artifacts:
reports:
codequality: swift-lint.json
# Lint the Rust code with Rustfmt and clippy
# We cache the environment - see https://stackoverflow.com/a/74888341
lint_rust:
stage: lint
image: "rust:latest"
variables:
# Move cargo data into the project directory so it can be cached
CARGO_HOME: ${CI_PROJECT_DIR}/.cargo
cache:
# Share cache between all Rust linting jobs
key: rust-lint
paths:
- .cargo/bin
- .cargo/registry/index
- .cargo/registry/cache
- target/debug/deps
- target/debug/build
script:
- rustup component add rustfmt clippy
- cargo fmt --manifest-path CellGuardAppRust/Cargo.toml --check
- cargo clippy --manifest-path CellGuardAppRust/Cargo.toml
# Build the Rust code
# We can only run this stage with a macOS runner :/
# [ERROR cargo_lipo] Running on non-macOS, `cargo lipo` will likely not work. Use `--allow-run-on-non-macos` to override this check.
#compile_rust:
# stage: build
# image: "rust:latest"
# variables:
# # Move cargo data into the project directory so it can be cached
# CARGO_HOME: ${CI_PROJECT_DIR}/.cargo
# cache:
# # Share cache between all Rust build jobs on one branch/tag
# key: ${CI_COMMIT_REF_SLUG}-rust-build
# paths:
# - .cargo/bin
# - .cargo/registry/index
# - .cargo/registry/cache
# - target/debug/deps
# - target/debug/build
# script:
# - rustup target add aarch64-apple-ios x86_64-apple-ios
# - cargo install cargo-lipo cargo-bundle-licenses
# - PROJECT_DIR=CellGuardAppSwift ./CellGuardAppSwift/build-rust.sh