Skip to content

Commit

Permalink
ci: remove pip and virtualenv
Browse files Browse the repository at this point in the history
  • Loading branch information
neolynx committed Oct 4, 2024
1 parent f0ad0f9 commit ee0def1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 30 deletions.
15 changes: 2 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ env:

jobs:
test:
name: "System Tests (Ubuntu 22.04)"
name: "Test (Ubuntu 22.04)"
runs-on: ubuntu-22.04
continue-on-error: false
timeout-minutes: 30
Expand All @@ -33,7 +33,7 @@ jobs:
- name: "Install packages"
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends graphviz gnupg2 gpgv2 git gcc make devscripts
sudo apt-get install -y --no-install-recommends graphviz gnupg2 gpgv2 git gcc make devscripts python3 python3-requests-unixsocket python3-termcolor python3-swiftclient python3-boto python3-azure-storage python3-etcd3 python3-plyvel flake8
- name: "Checkout repository"
uses: actions/checkout@v4
Expand All @@ -53,17 +53,6 @@ jobs:
with:
go-version: ${{ steps.goversion.outputs.GOVER }}

- name: "Setup Python"
uses: actions/setup-python@v4
with:
python-version: '3.11'

- name: "Install Python packages"
run: |
pip install six packaging appdirs virtualenv
pip install -U pip setuptools
pip install -r system/requirements.txt
- name: "Install Azurite"
id: azuright
uses: potatoqualitee/azuright@v1.1
Expand Down
20 changes: 4 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ RELEASE=no
help: ## Print this help
@grep -E '^[a-zA-Z][a-zA-Z0-9_-]*:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'

all: prepare test bench check system-test # used for system tests in ci
all: prepare test bench flake8 system-test # used for system tests in ci

prepare: ## Install go module dependencies
# set version
Expand All @@ -31,24 +31,12 @@ prepare: ## Install go module dependencies
go mod tidy -v
go generate

check: system/env
ifeq ($(RUN_LONG_TESTS), yes)
system/env/bin/flake8
endif

install:
@echo "\e[33m\e[1mBuilding aptly ...\e[0m"
go generate
@out=`mktemp`; if ! go install -v > $$out 2>&1; then cat $$out; rm -f $$out; echo "\nBuild failed\n"; exit 1; else rm -f $$out; fi

system/env: system/requirements.txt
ifeq ($(RUN_LONG_TESTS), yes)
rm -rf system/env
$(PYTHON) -m venv system/env
system/env/bin/pip install -r system/requirements.txt
endif

system-test: install system/env ## Run system tests in github CI
system-test: install ## Run system tests in github CI
ifeq ($(RUN_LONG_TESTS), yes)
go generate
# install etcd
Expand All @@ -61,7 +49,7 @@ ifeq ($(RUN_LONG_TESTS), yes)
if [ ! -e ~/aptly-fixture-db ]; then git clone https://github.com/aptly-dev/aptly-fixture-db.git ~/aptly-fixture-db/; fi
if [ ! -e ~/aptly-fixture-pool ]; then git clone https://github.com/aptly-dev/aptly-fixture-pool.git ~/aptly-fixture-pool/; fi
cd /home/runner; curl -O http://repo.aptly.info/system-tests/etcd.db.xz; xz -d etcd.db.xz
PATH=$(BINPATH)/:$(PATH) && . system/env/bin/activate && APTLY_VERSION=$(VERSION) FORCE_COLOR=1 $(PYTHON) system/run.py --long $(TESTS) --coverage-dir $(COVERAGE_DIR) $(CAPTURE)
PATH=$(BINPATH)/:$(PATH) && APTLY_VERSION=$(VERSION) FORCE_COLOR=1 $(PYTHON) system/run.py --long $(TESTS) --coverage-dir $(COVERAGE_DIR) $(CAPTURE)
endif

docker-test: ## Run system tests
Expand Down Expand Up @@ -223,4 +211,4 @@ clean: ## remove local build and module cache
rm -rf build/ docs/ obj-*-linux-gnu*
rm -f unit.out aptly.test

.PHONY: help man prepare version binaries docker-release docker-system-tests docker-unit-tests docker-lint docker-build docker-image build docker-shell clean releasetype dpkg dev-server docker-dev-server
.PHONY: help man prepare version binaries docker-release docker-system-tests docker-unit-tests docker-lint docker-build docker-image build docker-shell clean releasetype dpkg dev-server docker-dev-server flake8
2 changes: 1 addition & 1 deletion system/lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def __init__(self):
def find_dot(self, executables):
for executable in executables:
try:
subprocess.check_output([executable, "-V"], text=True)
subprocess.check_output([executable, "-V"], text=True, stderr=subprocess.DEVNULL)
return executable
except Exception:
pass
Expand Down

0 comments on commit ee0def1

Please sign in to comment.