|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [main, dev] |
| 6 | + pull_request: |
| 7 | + branches: [main, dev] |
| 8 | + |
| 9 | +jobs: |
| 10 | + lint: |
| 11 | + runs-on: ubuntu-latest |
| 12 | + steps: |
| 13 | + - uses: actions/checkout@v4 |
| 14 | + |
| 15 | + - uses: actions/setup-python@v5 |
| 16 | + with: |
| 17 | + python-version: '3.11' |
| 18 | + cache: 'pip' |
| 19 | + |
| 20 | + - name: Install ruff |
| 21 | + run: pip install ruff |
| 22 | + |
| 23 | + - name: Check formatting |
| 24 | + run: ruff format --check . |
| 25 | + |
| 26 | + - name: Lint |
| 27 | + run: ruff check . --output-format=github |
| 28 | + |
| 29 | + test: |
| 30 | + runs-on: ubuntu-latest |
| 31 | + strategy: |
| 32 | + matrix: |
| 33 | + python-version: ['3.9', '3.10', '3.11', '3.12'] |
| 34 | + |
| 35 | + steps: |
| 36 | + - uses: actions/checkout@v4 |
| 37 | + |
| 38 | + - uses: actions/setup-python@v5 |
| 39 | + with: |
| 40 | + python-version: ${{ matrix.python-version }} |
| 41 | + cache: 'pip' |
| 42 | + |
| 43 | + - name: Install dependencies |
| 44 | + run: | |
| 45 | + python -m pip install --upgrade pip |
| 46 | + pip install -r requirements-ci.txt |
| 47 | +
|
| 48 | + - name: Run tests |
| 49 | + run: | |
| 50 | + pytest --tb=short -q \ |
| 51 | + --cov=concore_cli --cov=concore_base \ |
| 52 | + --cov-report=term-missing \ |
| 53 | + --ignore=measurements/ \ |
| 54 | + --ignore=0mq/ \ |
| 55 | + --ignore=ratc/ \ |
| 56 | + --ignore=linktest/ |
| 57 | +
|
| 58 | + java-test: |
| 59 | + runs-on: ubuntu-latest |
| 60 | + steps: |
| 61 | + - uses: actions/checkout@v4 |
| 62 | + |
| 63 | + - uses: actions/setup-java@v4 |
| 64 | + with: |
| 65 | + distribution: 'temurin' |
| 66 | + java-version: '17' |
| 67 | + |
| 68 | + - name: Download jeromq |
| 69 | + run: | |
| 70 | + curl -fsSL -o jeromq.jar https://repo1.maven.org/maven2/org/zeromq/jeromq/0.6.0/jeromq-0.6.0.jar |
| 71 | +
|
| 72 | + - name: Compile Java tests |
| 73 | + run: | |
| 74 | + javac -cp jeromq.jar concoredocker.java TestLiteralEval.java TestConcoredockerApi.java |
| 75 | +
|
| 76 | + - name: Run Java tests |
| 77 | + run: | |
| 78 | + java -cp .:jeromq.jar TestLiteralEval |
| 79 | + java -cp .:jeromq.jar TestConcoredockerApi |
| 80 | +
|
| 81 | + docker-build: |
| 82 | + runs-on: ubuntu-latest |
| 83 | + steps: |
| 84 | + - uses: actions/checkout@v4 |
| 85 | + |
| 86 | + - name: Check if Dockerfile.py changed |
| 87 | + uses: dorny/paths-filter@v3 |
| 88 | + id: filter |
| 89 | + with: |
| 90 | + filters: | |
| 91 | + dockerfile: |
| 92 | + - 'Dockerfile.py' |
| 93 | + - 'requirements.txt' |
| 94 | +
|
| 95 | + - name: Validate Dockerfile build |
| 96 | + if: steps.filter.outputs.dockerfile == 'true' |
| 97 | + run: docker build -f Dockerfile.py -t concore-py-test . |
0 commit comments