fix: copy postgres config to the correct path #3667
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI Checks on PRs | |
| on: | |
| pull_request: | |
| branches: [main] | |
| push: | |
| branches: [main] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| # Disable incremental compilation. | |
| # | |
| # Incremental compilation is useful as part of an edit-build-test-edit cycle, | |
| # as it lets the compiler avoid recompiling code that hasn't changed. However, | |
| # on CI, we're not making small edits; we're almost always building the entire | |
| # project from scratch. Thus, incremental compilation on CI actually | |
| # introduces *additional* overhead to support making future builds | |
| # faster...but no future builds will ever occur in any given CI environment. | |
| # | |
| # See https://matklad.github.io/2021/09/04/fast-rust-builds.html#ci-workflow | |
| # for details. | |
| CARGO_INCREMENTAL: 0 | |
| # Allow more retries for network requests in cargo (downloading crates) and | |
| # rustup (installing toolchains). This should help to reduce flaky CI failures | |
| # from transient network timeouts or other issues. | |
| CARGO_NET_RETRY: 10 | |
| RUSTUP_MAX_RETRIES: 10 | |
| # Don't emit giant backtraces in the CI logs. | |
| RUST_BACKTRACE: short | |
| # Use cargo's sparse index protocol | |
| CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse | |
| AWS_ACCESS_KEY_ID: test | |
| AWS_SECRET_ACCESS_KEY: test | |
| AWS_SESSION_TOKEN: test | |
| AWS_REGION: ap-south-1 | |
| APP_ENV: "TEST" | |
| jobs: | |
| formatting: | |
| name: Check formatting | |
| runs-on: codebuild-superposition-${{ github.run_id }}-${{ github.run_attempt }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Restore cache (if present) | |
| uses: actions/cache/restore@v4 | |
| id: cache-restore | |
| with: | |
| path: | | |
| ~/.cargo/bin/ | |
| ~/.cargo/registry/index/ | |
| ~/.cargo/registry/cache/ | |
| ~/.cargo/git/db/ | |
| target/ | |
| key: ${{ runner.os }}-cargo-test-${{ hashFiles('**/Cargo.lock') }} | |
| restore-keys: ${{ runner.os }}-cargo-test- | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: 1.86.0 | |
| targets: wasm32-unknown-unknown | |
| components: rustfmt, clippy | |
| - name: Install leptosfmt | |
| uses: baptiste0928/[email protected] | |
| with: | |
| crate: leptosfmt | |
| version: "0.1.33" | |
| - name: Check formatting & linting | |
| shell: bash | |
| run: make check | |
| - name: install cocogitto | |
| uses: baptiste0928/[email protected] | |
| with: | |
| crate: cocogitto | |
| - name: Check conventional commit | |
| shell: bash | |
| run: | | |
| if [[ "${{ github.event_name }}" == "pull_request" ]]; then | |
| git config --global user.name "${{ github.event.pull_request.user.login }}" | |
| commit=$(git log --format=%B -n 1 ${{ github.event.pull_request.head.sha }}) | |
| else | |
| git config --global user.name "${{ github.event.pusher.name }}" | |
| commit=$(git log --format=%B -n 1 ${{ github.sha }}) | |
| fi | |
| git config --global user.email "[email protected]" | |
| cog verify "$commit" | |
| test: | |
| name: Testing | |
| runs-on: codebuild-superposition-${{ github.run_id }}-${{ github.run_attempt }} | |
| services: | |
| postgres: | |
| image: public.ecr.aws/docker/library/postgres:15-alpine3.21 | |
| ports: | |
| - 5432:5432 | |
| env: | |
| POSTGRES_PASSWORD: "docker" | |
| POSTGRES_DB: "config" | |
| restart: on-failure | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Restore cache (if present) | |
| uses: actions/cache/restore@v4 | |
| id: cache-restore | |
| with: | |
| path: | | |
| ~/.cargo/bin/ | |
| ~/.cargo/registry/index/ | |
| ~/.cargo/registry/cache/ | |
| ~/.cargo/git/db/ | |
| target/ | |
| key: ${{ runner.os }}-cargo-test-${{ hashFiles('**/Cargo.lock') }} | |
| restore-keys: ${{ runner.os }}-cargo-test- | |
| - name: Install postgres libs | |
| run: | | |
| sudo apt update | |
| sudo apt-get -y install postgresql libpq-dev | |
| - name: Install Bun | |
| uses: oven-sh/setup-bun@v2 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: 1.86.0 | |
| targets: wasm32-unknown-unknown | |
| components: rustfmt, clippy | |
| - name: install node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 18.19.0 | |
| - name: Install wasm-pack | |
| shell: bash | |
| run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh | |
| - name: run tests | |
| shell: bash | |
| run: | | |
| make test CI=1 | |
| env: | |
| APP_ENV: "TEST" | |
| - name: run jsonlogic tests | |
| shell: bash | |
| run: | | |
| make test_jsonlogic CI=1 | |
| env: | |
| APP_ENV: "TEST" | |
| - name: save/update cache for future runs | |
| uses: actions/cache/save@v4 | |
| id: cache-save | |
| if: github.ref == 'refs/heads/main' | |
| with: | |
| path: | | |
| ~/.cargo/bin/ | |
| ~/.cargo/registry/index/ | |
| ~/.cargo/registry/cache/ | |
| ~/.cargo/git/db/ | |
| target/ | |
| key: ${{ runner.os }}-cargo-test-${{ hashFiles('**/Cargo.lock') }} | |
| java-build: | |
| name: Java build | |
| runs-on: codebuild-superposition-${{ github.run_id }}-${{ github.run_attempt }} | |
| defaults: | |
| run: | |
| working-directory: clients/java | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Restore cache (if present) | |
| uses: actions/cache/restore@v4 | |
| with: | |
| path: | | |
| ~/.gradle/caches | |
| ~/.gradle/wrapper | |
| key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
| restore-keys: | | |
| ${{ runner.os }}-gradle- | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: "17" | |
| distribution: "temurin" | |
| - name: Make gradlew executable | |
| run: chmod +x gradlew | |
| - name: Run Gradle assemble | |
| run: ./gradlew assemble | |
| ## This requires more setup. Specifically, we need the server to be up w/ | |
| ## some dummy data. | |
| # - name: Run tests | |
| # run: ./gradlew test | |
| - name: save/update cache for future runs | |
| uses: actions/cache/save@v4 | |
| if: github.ref == 'refs/heads/main' | |
| with: | |
| path: | | |
| ~/.gradle/caches | |
| ~/.gradle/wrapper | |
| key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
| - name: Upload build artifacts | |
| if: failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: build-reports | |
| path: | | |
| build/reports/ | |
| build/test-results/ | |
| retention-days: 7 | |
| provider-tests: | |
| name: Provider Tests | |
| runs-on: codebuild-superposition-${{ github.run_id }}-${{ github.run_attempt }} | |
| strategy: | |
| matrix: | |
| provider: | |
| - kotlin | |
| - js | |
| - py | |
| - rust | |
| services: | |
| postgres: | |
| image: public.ecr.aws/docker/library/postgres:15-alpine3.21 | |
| ports: | |
| - 5432:5432 | |
| env: | |
| POSTGRES_PASSWORD: "docker" | |
| POSTGRES_DB: "config" | |
| restart: on-failure | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Install postgres libs | |
| run: | | |
| sudo apt update | |
| sudo apt-get -y install postgresql libpq-dev | |
| - name: Install Bun | |
| uses: oven-sh/setup-bun@v2 | |
| - name: make binary executable | |
| run: chmod +x scripts/setup_provider_binaries.sh | |
| - name: Restore cache (if present) | |
| uses: actions/cache/restore@v4 | |
| id: cache-restore | |
| with: | |
| path: | | |
| ~/.cargo/bin/ | |
| ~/.cargo/registry/index/ | |
| ~/.cargo/registry/cache/ | |
| ~/.cargo/git/db/ | |
| target/ | |
| key: ${{ runner.os }}-cargo-test-${{ hashFiles('**/Cargo.lock') }} | |
| restore-keys: ${{ runner.os }}-cargo-test- | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: 1.86.0 | |
| targets: wasm32-unknown-unknown | |
| components: rustfmt, clippy | |
| - name: Set up JDK 17 (for Kotlin tests) | |
| if: matrix.provider == 'kotlin' | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: "17" | |
| distribution: "temurin" | |
| - name: Make gradlew executable | |
| if: matrix.provider == 'kotlin' | |
| run: chmod +x clients/java/gradlew | |
| - name: Run Gradle assemble | |
| if: matrix.provider == 'kotlin' | |
| run: cd clients/java && ./gradlew assemble | |
| - name: Install Node.js (for JS tests) | |
| if: matrix.provider == 'js' | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 24.1.0 | |
| - name: Set up Python (for Python tests) | |
| if: matrix.provider == 'py' | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.12" | |
| - name: Install uv | |
| if: matrix.provider == 'py' | |
| uses: astral-sh/setup-uv@v3 | |
| with: | |
| version: "latest" | |
| - name: Run provider tests | |
| shell: bash | |
| run: | | |
| cargo build --package superposition_core | |
| export UV_PROJECT_ENVIRONMENT="${pythonLocation}" | |
| echo "UV_PROJECT_ENVIRONMENT: $UV_PROJECT_ENVIRONMENT" | |
| make test-${{ matrix.provider }}-provider | |
| env: | |
| APP_ENV: "TEST" |