|
| 1 | +name: Test workflow |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + branches: [ "master" ] |
| 6 | + |
| 7 | +jobs: |
| 8 | + set-up-env: |
| 9 | + strategy: |
| 10 | + matrix: |
| 11 | + python-version: [ "3.12" ] # TODO: Add other Python versions |
| 12 | + runs-on: ubuntu-24.04 |
| 13 | + steps: |
| 14 | + - uses: actions/checkout@v4 |
| 15 | + - name: Set up Python ${{ matrix.python-version }} |
| 16 | + uses: actions/setup-python@v5 |
| 17 | + with: |
| 18 | + python-version: ${{ matrix.python-version }} |
| 19 | + - name: Install dependencies |
| 20 | + run: sudo apt-get update && sudo apt-get install dpkg-dev |
| 21 | + - name: Set up venv |
| 22 | + run: | |
| 23 | + python3 -m venv venv |
| 24 | + ./venv/bin/activate |
| 25 | + pip install pyinotify pyasyncore |
| 26 | + - name: Upload venv artifact |
| 27 | + uses: actions/upload-artifact@v3 |
| 28 | + with: |
| 29 | + name: venv-${{ matrix.python-version }} |
| 30 | + path: venv |
| 31 | + |
| 32 | + run-server: |
| 33 | + strategy: |
| 34 | + matrix: |
| 35 | + python-version: [ "3.12" ] # TODO: Add other Python versions |
| 36 | + runs-on: ubuntu-24.04 |
| 37 | + needs: [ set-up-env ] |
| 38 | + steps: |
| 39 | + - uses: actions/checkout@v4 |
| 40 | + - name: Download venv artifact |
| 41 | + uses: actions/download-artifact@v3 |
| 42 | + with: |
| 43 | + name: venv-${{ matrix.python-version }} |
| 44 | + path: venv |
| 45 | + - name: Create and populate config.json |
| 46 | + run: | |
| 47 | + echo '{ |
| 48 | + "architectures": ["amd64", "armhf", "arm64"], |
| 49 | + "dists": ["jammy", "noble"], |
| 50 | + "short_name": "test_repo", |
| 51 | + "description": "Local test repository", |
| 52 | + |
| 53 | + "name": "Admin User", |
| 54 | + "port": 8645, |
| 55 | + "auth": "none" |
| 56 | + }' > config.json |
| 57 | + - name: Run server |
| 58 | + run: timeout 20s ./venv/bin/python debianrepo -c config.json || true |
| 59 | + - name: Check files |
| 60 | + run: ls -al |
0 commit comments