|
| 1 | +name: IAM CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + paths: |
| 6 | + - iam/** |
| 7 | + - .github/workflows/iam.yml |
| 8 | + pull_request: |
| 9 | + paths: |
| 10 | + - iam/** |
| 11 | + - .github/workflows/iam.yml |
| 12 | + |
| 13 | +jobs: |
| 14 | + test: |
| 15 | + runs-on: ubuntu-latest |
| 16 | + timeout-minutes: 15 |
| 17 | + permissions: |
| 18 | + contents: read |
| 19 | + strategy: |
| 20 | + fail-fast: false |
| 21 | + matrix: |
| 22 | + runner: [curl, java, python] |
| 23 | + |
| 24 | + env: |
| 25 | + ARCADEDB_URL: http://localhost:2480 |
| 26 | + ARCADEDB_USER: root |
| 27 | + ARCADEDB_PASS: arcadedb |
| 28 | + |
| 29 | + steps: |
| 30 | + - name: Checkout |
| 31 | + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
| 32 | + with: |
| 33 | + fetch-depth: 1 |
| 34 | + |
| 35 | + - name: Set up Java |
| 36 | + if: matrix.runner == 'java' |
| 37 | + uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0 |
| 38 | + with: |
| 39 | + java-version: '21' |
| 40 | + distribution: 'temurin' |
| 41 | + |
| 42 | + - name: Cache Maven repository |
| 43 | + if: matrix.runner == 'java' |
| 44 | + uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3 |
| 45 | + with: |
| 46 | + path: ~/.m2 |
| 47 | + key: ${{ runner.os }}-m2-iam-${{ hashFiles('iam/java/pom.xml') }} |
| 48 | + restore-keys: ${{ runner.os }}-m2-iam- |
| 49 | + |
| 50 | + - name: Set up Python |
| 51 | + if: matrix.runner == 'python' |
| 52 | + uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 |
| 53 | + with: |
| 54 | + python-version: '3.12' |
| 55 | + |
| 56 | + - name: Cache pip |
| 57 | + if: matrix.runner == 'python' |
| 58 | + uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3 |
| 59 | + with: |
| 60 | + path: ~/.cache/pip |
| 61 | + key: ${{ runner.os }}-pip-iam-${{ hashFiles('iam/python/requirements.txt') }} |
| 62 | + restore-keys: ${{ runner.os }}-pip-iam- |
| 63 | + |
| 64 | + - name: Install Python dependencies |
| 65 | + if: matrix.runner == 'python' |
| 66 | + working-directory: iam/python |
| 67 | + run: pip install -r requirements.txt |
| 68 | + |
| 69 | + - name: Start ArcadeDB |
| 70 | + working-directory: iam |
| 71 | + run: docker compose up -d |
| 72 | + |
| 73 | + - name: Setup database |
| 74 | + working-directory: iam |
| 75 | + run: ./setup.sh |
| 76 | + |
| 77 | + - name: Run curl queries |
| 78 | + if: matrix.runner == 'curl' |
| 79 | + working-directory: iam |
| 80 | + run: ./queries/queries.sh |
| 81 | + |
| 82 | + - name: Build and run Java |
| 83 | + if: matrix.runner == 'java' |
| 84 | + working-directory: iam/java |
| 85 | + run: | |
| 86 | + mvn package --no-transfer-progress |
| 87 | + java -jar target/iam.jar |
| 88 | +
|
| 89 | + - name: Run Python queries |
| 90 | + if: matrix.runner == 'python' |
| 91 | + working-directory: iam/python |
| 92 | + run: python iam.py |
| 93 | + |
| 94 | + - name: Teardown |
| 95 | + if: always() |
| 96 | + working-directory: iam |
| 97 | + run: docker compose down |
0 commit comments