depends_on: - build - test when: - event: [pull_request, tag] - event: push branch: - ${CI_REPO_DEFAULT_BRANCH} variables: - &rust_image 'git.nikos.gg/prymn/images/rust:33331dfc' - &elixir_image 'git.nikos.gg/prymn/images/elixir:1794cee2' - &when_elixir - path: - "**/*.{ex,exs}" - "mix.*" - &cache_settings endpoint: https://75178f9eca227dea51b3db4db2c15a5a.r2.cloudflarestorage.com bucket: prymn-cache region: auto access-key: from_secret: R2_CACHE_ACCESS_KEY secret-key: from_secret: R2_CACHE_SECRET_KEY steps: restore-elixir-cache: image: meltwater/drone-cache pull: true settings: <<: *cache_settings cache_key: '{{ .Commit.Branch }}-{{ checksum "app/mix.lock" }}' restore: true mount: - 'app/deps' - 'app/_build/dev' rust-lint: image: *rust_image group: lint secrets: [ R2_CACHE_ACCESS_KEY, R2_CACHE_SECRET_KEY ] commands: - export AWS_ACCESS_KEY_ID="$${R2_CACHE_ACCESS_KEY}" - export AWS_SECRET_ACCESS_KEY="$${R2_CACHE_SECRET_KEY}" - rustup component add clippy rustfmt - cargo clippy -- -D warnings - cargo fmt --all -- --check when: - path: - "**/*.rs" - "Cargo.*" elixir-credo: image: *elixir_image group: lint commands: - cd app - mix credo when: *when_elixir elixir-dialyzer: image: *elixir_image group: lint commands: - cd app - mix dialyzer --format short when: *when_elixir elixir-format: image: *elixir_image group: lint commands: - cd app - mix format --check-formatted when: *when_elixir