From f02b9149863efe3e883806b7d470ab3c55273d03 Mon Sep 17 00:00:00 2001 From: "Douglas Cerna (Soy Douglas)" Date: Fri, 4 Dec 2020 18:48:03 -0600 Subject: [PATCH] Use Github Actions --- .github/workflows/integration.yml | 22 -------- .github/workflows/test.yml | 90 +++++++++++++++++++++++++++++++ .travis.yml | 50 ----------------- 3 files changed, 90 insertions(+), 72 deletions(-) delete mode 100644 .github/workflows/integration.yml create mode 100644 .github/workflows/test.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml deleted file mode 100644 index 20bae601e..000000000 --- a/.github/workflows/integration.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: Integration -on: - pull_request: - push: - branches: - - qa/** - - stable/** -jobs: - integration: - runs-on: ubuntu-18.04 - steps: - - name: Check out source code - uses: actions/checkout@v2 - - name: Run tests - run: | - docker-compose run --rm archivematica-storage-service - docker-compose down --volumes - shell: bash - working-directory: integration - env: - COMPOSE_DOCKER_CLI_BUILD: 1 - DOCKER_BUILDKIT: 1 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 000000000..56bb57e5a --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,90 @@ +--- +name: "Test" +on: + pull_request: + push: + branches: + - "qa/**" + - "stable/**" +jobs: + test: + name: "Test ${{ matrix.name }}" + runs-on: "ubuntu-18.04" + strategy: + matrix: + include: + - name: "py27" + python-version: "2.7" + toxenv: "py27" + - name: "py27-checkformigrations" + python-version: "2.7" + toxenv: "checkformigrations" + steps: + - name: "Check out repository" + uses: "actions/checkout@v2" + - name: "Set up Python ${{ matrix.python-version }}" + uses: "actions/setup-python@v2" + with: + python-version: "${{ matrix.python-version }}" + - name: "Install OS packages" + run: | + sudo apt-get --quiet update + sudo apt-get install --quiet --yes build-essential \ + libmysqlclient-dev libsasl2-dev libldap2-dev libssl-dev \ + p7zip-full unar + - name: "Create directories needed by test_duracloud.py" + run: | + sudo mkdir -p /var/archivematica/storage_service + sudo chown -R $USER /var/archivematica/storage_service + - name: "Get pip cache dir" + id: "pip-cache" + run: | + echo "::set-output name=dir::$(pip cache dir)" + - name: "Cache pip packages" + uses: "actions/cache@v2" + with: + path: "${{ steps.pip-cache.outputs.dir }}" + key: "${{ runner.os }}-pip-${{ hashFiles('**/requirements/test.txt') }}" + restore-keys: | + ${{ runner.os }}-pip- + - name: "Install tox" + run: | + python -m pip install --upgrade pip + pip install tox + - name: "Run tox" + env: + TOXENV: ${{ matrix.toxenv }} + run: | + tox + integration: + name: "Integration" + runs-on: "ubuntu-18.04" + steps: + - name: "Check out repository" + uses: "actions/checkout@v2" + - name: "Run tests" + run: | + docker-compose run --rm archivematica-storage-service + docker-compose down --volumes + shell: "bash" + working-directory: "integration" + env: + COMPOSE_DOCKER_CLI_BUILD: 1 + DOCKER_BUILDKIT: 1 + linting: + name: "Lint" + runs-on: "ubuntu-18.04" + steps: + - name: "Check out repository" + uses: "actions/checkout@v2" + - name: "Set up Python 3.6" + uses: "actions/setup-python@v2" + with: + python-version: "3.6" + - name: "Install tox" + run: | + python -m pip install --upgrade pip + pip install tox + - name: "Run tox" + run: | + tox -e linting diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 5ff32746c..000000000 --- a/.travis.yml +++ /dev/null @@ -1,50 +0,0 @@ ---- - -dist: trusty -sudo: false -language: python - -branches: - only: - - qa/0.x - - /^stable\/\d+\.\d+\.x$/ - -addons: - apt: - packages: - - python-pip - - p7zip-full - - unar - -cache: - - pip - -before_install: - - pip install tox - -install: true - -before_script: - # Needed by test_duracloud.py - - sudo mkdir -p /var/archivematica/storage_service - - sudo chown -R $USER /var/archivematica/storage_service - -script: tox - -notifications: - email: false - -matrix: - fast_finish: true - include: - - python: "2.7" - env: TOXENV=py27 - - python: "3.6" - env: TOXENV=py36 - - python: "3.6" - env: TOXENV=linting - - python: "2.7" - env: TOXENV=checkformigrations - allow_failures: - - python: "3.6" - env: TOXENV=py36