diff --git a/.circleci/config.yml b/.circleci/config.yml index 4eec953f5b1..72c6d216ea9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -77,11 +77,10 @@ jobs: docker: - image: cimg/rust:<< pipeline.parameters.rust-version >> - image: cimg/postgres:17.0-postgis - name: postgres environment: POSTGRES_DB: postgres POSTGRES_USER: postgres - POSTGRES_PASSWORD: password + POSTGRES_PASSWORD: password$ steps: - checkout - setup_remote_docker @@ -96,37 +95,29 @@ jobs: - restore_cache: keys: - tests-editoast-{{ checksum "/tmp/src_checksum" }} + - run: - name: Run Editoast Tests - working_directory: editoast + name: Install and run OpenFGA + background: true environment: - DATABASE_URL: postgres://osrd:password@localhost/osrd - CI: "true" OPENFGA_DATASTORE_ENGINE: "postgres" OPENFGA_DATASTORE_URI: "postgres://osrd:password@postgres:5432/osrd?search_path=openfga" OPENFGA_HTTP_ADDR: "0.0.0.0:8091" command: | - echo "DEBUG" - docker inspect $(docker ps -q --filter ancestor=cimg/postgres:17.0-postgis | head -n 1) - echo "END DEBUG" + sudo mkdir -p /opt/openfga + curl -L https://github.com/openfga/openfga/releases/download/v1.8.6/openfga_1.8.6_linux_arm64.tar.gz | sudo tar -xz -C /opt/openfga + /opt/openfga/openfga migrate + /opt/openfga/openfg run + - run: + name: Run Editoast Tests + working_directory: editoast + environment: + DATABASE_URL: postgres://osrd:password@localhost/osrd + CI: "true" + command: | if [ ! -f "/tmp/tests_passed" ]; then psql postgresql://postgres:password@localhost -f ../docker/init_db.sql - - docker run --rm \ - -e OPENFGA_DATASTORE_ENGINE \ - -e OPENFGA_DATASTORE_URI \ - -e OPENFGA_HTTP_ADDR \ - openfga/openfga:v<< pipeline.parameters.openfga-version >> migrate - - # Run openfga - docker run --rm -d \ - -e OPENFGA_DATASTORE_ENGINE \ - -e OPENFGA_DATASTORE_URI \ - -e OPENFGA_HTTP_ADDR \ - -p 8091:8091 \ - openfga/openfga:v<< pipeline.parameters.openfga-version >> run - sudo apt-get update sudo apt-get install -y libgeos-dev libpq-dev cargo install diesel_cli --no-default-features --features postgres