From 49e9a7e2e4dfb936c24f6075d91b94f243a04c0b Mon Sep 17 00:00:00 2001 From: Erik Moeller Date: Thu, 11 Apr 2024 17:25:21 -0700 Subject: [PATCH] [WIP] Migrate `make test` and `make reprotest` to GitHub Actions --- .circleci/config.yml | 69 --------------------------------- .github/workflows/ci.yml | 21 +++++++--- .github/workflows/reprotest.yml | 31 +++++++++++++++ 3 files changed, 47 insertions(+), 74 deletions(-) delete mode 100644 .circleci/config.yml create mode 100644 .github/workflows/reprotest.yml diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 1025283..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,69 +0,0 @@ ---- -common-steps: - - - &installdeps - run: - name: Install Debian packaging dependencies - command: | - apt-get update && apt-get install -y make sudo - make install-deps - - - &installtestdeps - run: - name: Install test dependencies - command: | - apt-get install reprotest faketime -y --no-install-recommends - .venv/bin/pip install -r test-requirements.txt - - -version: 2.1 - -jobs: - lint-and-test: - docker: - - image: debian:bullseye - steps: - - checkout - - *installdeps - - *installtestdeps - - run: - name: install test requirements, run linters, and run tests - command: | - source .venv/bin/activate - sed -i -re "292s/^(\s+).*\$/\1return _.prepend_to_build_command_raw('')/" /usr/lib/python3/dist-packages/reprotest/build.py - make test - - reprotest-wheels: - docker: - - image: debian:bullseye - # Our "ci" user will have problems if the repository is in /root - working_directory: "/srv" - steps: - - checkout - - *installdeps - - *installtestdeps - - run: - name: install test requirements and run tests - command: | - adduser --system ci --ingroup root - sed -i -re "292s/^(\s+).*\$/\1return _.prepend_to_build_command_raw('')/" /usr/lib/python3/dist-packages/reprotest/build.py - # Have our "ci" user take over the git repo - chown ci:root -R . - sudo -u ci bash -c "source .venv/bin/activate && pytest -vvs tests/test_reproducible_wheels.py" - -workflows: - builder_ci: - jobs: - - lint-and-test - - reprotest-wheels - - nightly: - triggers: - - schedule: - cron: "0 6 * * *" - filters: - branches: - only: - - main - jobs: - - reprotest-wheels diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cba9abb..2e748fa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,11 +8,22 @@ jobs: runs-on: ubuntu-latest container: debian:bullseye steps: + - name: Bootstrap Debian system package dependencies + run: | + apt-get update && apt-get install --yes --no-install-recommends make sudo git git-lfs ca-certificates - uses: actions/checkout@v4 - - name: Install dependencies + with: + lfs: true + - name: Install additional packages and Python dependencies + run: | + # Installs Python & bootstrap wheels, and initializes a virtualenv at .venv + make install-deps + ./.venv/bin/pip install -r test-requirements.txt + - name: Run linters run: | - apt-get update && apt-get install --yes --no-install-recommends make python3-pip - pip install -r test-requirements.txt - - name: Run lint checks + . ./.venv/bin/activate + make lint + - name: Run tests except reprotest run: | - make lint \ No newline at end of file + . ./.venv/bin/activate + make test \ No newline at end of file diff --git a/.github/workflows/reprotest.yml b/.github/workflows/reprotest.yml new file mode 100644 index 0000000..76b4c5c --- /dev/null +++ b/.github/workflows/reprotest.yml @@ -0,0 +1,31 @@ +--- +name: CI + +on: + push: + pull_request: + schedule: + - cron: "0 6 * * *" + +jobs: + checks: + runs-on: ubuntu-latest + container: debian:bullseye + steps: + - name: Bootstrap Debian system package dependencies + run: | + apt-get update && apt-get install --yes --no-install-recommends make sudo git git-lfs ca-certificates + - uses: actions/checkout@v4 + with: + lfs: true + - name: Install additional packages and Python dependencies + run: | + # Installs Python & bootstrap wheels, and initializes a virtualenv at .venv + make install-deps + ./.venv/bin/pip install -r test-requirements.txt + - name: Test wheel reproducibility + run: | + git config --global --add safe.directory "*" + adduser --system ci --ingroup root + chown ci:root -R . + sudo -u ci bash -c "source .venv/bin/activate && pytest -vvs tests/test_reproducible_wheels.py" \ No newline at end of file