-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
12b158d
commit 8cd2a3a
Showing
1 changed file
with
71 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
name: Test workflow | ||
|
||
on: | ||
pull_request: | ||
branches: [ "master" ] | ||
|
||
jobs: | ||
set-up-env: | ||
strategy: | ||
matrix: | ||
python-version: [ "3.12" ] # TODO: Add other Python versions | ||
runs-on: ubuntu-24.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: sudo apt-get update && sudo apt-get install dpkg-dev | ||
- name: Set up venv | ||
run: | | ||
python3 -m venv venv | ||
./venv/bin/activate | ||
pip install pyinotify pyasyncore | ||
- name: Upload venv artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: venv-${{ matrix.python-version }} | ||
path: venv | ||
|
||
test-repo: | ||
strategy: | ||
matrix: | ||
python-version: [ "3.12" ] # TODO: Add other Python versions | ||
runs-on: ubuntu-24.04 | ||
needs: [ set-up-env ] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Download venv artifact | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: venv-${{ matrix.python-version }} | ||
path: venv | ||
- name: Create and populate config.json | ||
run: | | ||
echo '{ | ||
"architectures": ["amd64", "armhf", "arm64"], | ||
"dists": ["jammy", "noble"], | ||
"short_name": "test_repo", | ||
"description": "Local test repository", | ||
"email": "[email protected]", | ||
"name": "Admin User", | ||
"port": 8645, | ||
"auth": "none" | ||
}' > config.json | ||
- name: Run repo | ||
run: | | ||
chmod -R +xr venv | ||
./venv/bin/activate | ||
nohup python3 debianrepo -c config.json & | ||
sleep 10 | ||
- name: Test repo usage | ||
run: | | ||
sudo apt-get update && sudo apt-get install wget | ||
wget -qO- http://127.0.0.1:8645/publickey.gpg | gpg --dearmor | sudo tee /usr/share/keyrings/local_test.gpg >/dev/null | ||
echo "deb [arch=amd64, signed-by=/usr/share/keyrings/local_test.gpg] http://127.0.0.1:8645/debian noble stable" | sudo tee /etc/apt/sources.list.d/local_test.list | ||
sudo apt-get update | ||
- name: Stop repo | ||
run: kill $(lsof -t -i:8645) | ||
|