/ .github / workflows / ci.yml
ci.yml
  1  name: CI
  2  
  3  on: [push, pull_request]
  4  
  5  jobs:
  6    lint-console:
  7      runs-on: ubuntu-latest
  8      steps:
  9        - name: Check out
 10          uses: actions/checkout@v3
 11        - name: Setup pnpm
 12          uses: pnpm/action-setup@v4
 13          with:
 14            version: 9.0.6
 15            run_install: |
 16              - recursive: true
 17                args: [--frozen-lockfile, --strict-peer-dependencies]
 18        - name: Run prettier
 19          run: |
 20            cd webui
 21            pnpm check
 22            
 23    build-rust:
 24      runs-on: ubicloud-standard-16
 25      env:
 26        DATABASE_URL: "postgres://arroyo:arroyo@localhost:5432/arroyo"
 27      steps:
 28        - name: Check out
 29          uses: actions/checkout@v3
 30        - uses: actions/setup-java@v3
 31          with:
 32            distribution: 'temurin'
 33            java-version: '11'
 34        - name: Install Rust
 35          uses: actions-rs/toolchain@v1
 36          with:
 37            toolchain: stable
 38            override: true
 39        - name: Check Formatting
 40          run: cargo fmt -- --check
 41        - name: Setup pnpm
 42          uses: pnpm/action-setup@v4
 43          with:
 44            version: 9.0.6
 45            run_install: |
 46              - recursive: true
 47                args: [--frozen-lockfile, --strict-peer-dependencies]        
 48        - name: Install OpenAPI Generator
 49          run: |
 50            pnpm install @openapitools/openapi-generator-cli -g
 51            cd crates/arroyo-openapi && openapi-generator-cli version
 52        - name: Setup Postgres
 53          run: |
 54            sudo apt-get update
 55            sudo apt-get install postgresql
 56            sudo systemctl start postgresql
 57            sudo -u postgres psql -c "CREATE USER arroyo WITH PASSWORD 'arroyo' SUPERUSER;"
 58            sudo -u postgres createdb arroyo
 59            pushd /tmp
 60              wget https://github.com/rust-db/refinery/releases/download/0.8.7/refinery-0.8.7-x86_64-unknown-linux-musl.tar.gz
 61              tar xvfz refinery*.tar.gz
 62              mv /tmp/refinery*-musl/refinery /tmp
 63            popd
 64            /tmp/refinery migrate -e DATABASE_URL -p crates/arroyo-api/migrations
 65        - name: Install dependencies
 66          run: |
 67            curl -LsSf https://get.nexte.st/latest/linux | tar zxf - -C ${CARGO_HOME:-~/.cargo}/bin
 68            sudo apt-get install -y cmake clang ruby unzip postgresql libsasl2-dev netcat
 69            wget https://github.com/protocolbuffers/protobuf/releases/download/v21.8/protoc-21.8-linux-x86_64.zip
 70            unzip protoc*.zip
 71            sudo mv bin/protoc /usr/local/bin
 72            curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
 73        - name: Install Kafka
 74          run: |
 75            wget --progress=dot --show-progress https://archive.apache.org/dist/kafka/3.5.0/kafka_2.12-3.5.0.tgz
 76            tar xvfz kafka*.tgz
 77            mkdir /tmp/kraft-combined-logs
 78            kafka_*/bin/kafka-storage.sh format -t 9v5PspiySuWU2l5NjTgRuA -c kafka_*/config/kraft/server.properties
 79            kafka_*/bin/kafka-server-start.sh -daemon kafka_*/config/kraft/server.properties
 80        - name: Install mosquitto
 81          run: |
 82            sudo apt-get install -y mosquitto
 83            sudo service mosquitto start
 84        - name: Check Formatting
 85          run: cargo fmt -- --check
 86        - name: Build console
 87          run: |
 88            cd webui
 89            pnpm build
 90        - name: Build
 91          run: cargo build --all-features
 92        - name: Test
 93          run: cargo nextest run -E 'kind(lib)' --all-features
 94        - name: Integ postgres
 95          run: |
 96            mkdir /tmp/arroyo-integ
 97            ARROYO__DISABLE_TELEMETRY=true ARROYO__CHECKPOINT_URL=file:///tmp/arroyo-integ ARROYO__COMPILER__ARTIFACT_URL=file:///tmp/artifacts target/debug/arroyo cluster &
 98            cargo nextest run --package integ -E 'kind(test)'
 99        - name: Integ sqlite
100          run: |
101            killall arroyo
102            ARROYO__DISABLE_TELEMETRY=true ARROYO__CHECKPOINT_URL=file:///tmp/arroyo-integ ARROYO__COMPILER__ARTIFACT_URL=file:///tmp/artifacts ARROYO__DATABASE__TYPE=sqlite target/debug/arroyo cluster &
103            timeout=10; while ! nc -z localhost 5115 && [ $timeout -gt 0 ]; do sleep 1; timeout=$((timeout - 1)); done; [ $timeout -gt 0 ]
104            cargo nextest run --package integ -E 'kind(test)'
105            
106    build-console:
107      runs-on: ubuntu-latest
108      steps:
109        - name: Check out
110          uses: actions/checkout@v3
111        - name: Setup pnpm
112          uses: pnpm/action-setup@v4
113          with:
114            version: 9.0.6
115            run_install: |
116              - recursive: true
117                args: [--frozen-lockfile, --strict-peer-dependencies]
118        - name: Build console
119          run: |
120            cd webui
121            pnpm build