🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
# Test a Clojure application with GitLab CI/CD > 原文:[https://docs.gitlab.com/ee/ci/examples/test-clojure-application.html](https://docs.gitlab.com/ee/ci/examples/test-clojure-application.html) * [Configure the project](#configure-the-project) **注意:**本文档最近未更新,可能已过期. 有关最新文档,请参见[GitLab CI / CD](../README.html)页面和《 [GitLab CI / CD 管道配置参考》](../yaml/README.html) . # Test a Clojure application with GitLab CI/CD[](#test-a-clojure-application-with-gitlab-cicd "Permalink") 本示例将指导您如何在 Clojure 应用程序上运行测试. 您可以查看或派生[示例源,](https://gitlab.com/dzaporozhets/clojure-web-application)并查看其过去的[CI 作业](https://gitlab.com/dzaporozhets/clojure-web-application/builds?scope=finished)的日志. ## Configure the project[](#configure-the-project "Permalink") 这是此项目的`.gitlab-ci.yml`文件的外观: ``` variables: POSTGRES_DB: sample-test DATABASE_URL: "postgresql://postgres@postgres:5432/sample-test" before_script: - apt-get update -y - apt-get install default-jre postgresql-client -y - wget https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein - chmod a+x lein - export LEIN_ROOT=1 - PATH=$PATH:. - lein deps - lein migratus migrate test: script: - lein test ``` 在`before_script` ,我们安装了 JRE 和[Leiningen](https://leiningen.org/) . 该示例项目使用[migratus](https://github.com/yogthos/migratus)库管理数据库迁移,并且在`before_script`的最后一步中添加了数据库迁移. 您可以使用`gitlab.com`可用的公共`gitlab.com`程序来使用此配置测试您的应用程序.