Skip to content

Development environment fixes #1087

Development environment fixes

Development environment fixes #1087

Workflow file for this run

---
name: "Test"
on:
pull_request:
push:
branches:
- "qa/**"
- "stable/**"
jobs:
test:
name: "Test ${{ matrix.rule }}"
runs-on: "ubuntu-22.04"
strategy:
fail-fast: false
matrix:
include:
- rule: mcp-server
coverage: true
- rule: mcp-client
coverage: true
- rule: dashboard
coverage: true
- rule: archivematica-common
coverage: true
- rule: storage-service
coverage: false
- rule: migrations
coverage: false
steps:
- name: "Check out repository"
uses: "actions/checkout@v3"
- name: "Check out the archivematica-storage-service submodule"
run: |
git submodule update --init hack/submodules/archivematica-storage-service/
- name: "Set up pip cache"
uses: "actions/cache@v3"
with:
path: "~/.cache/pip"
key: "${{ runner.os }}-pip-${{ github.sha }}"
restore-keys: |
${{ runner.os }}-pip-
- name: "Set up tox cache"
uses: "actions/cache@v3"
with:
path: ./.tox
key: "${{ runner.os }}-tox-${{ matrix.rule }}-${{ hashFiles('**/tox.ini', '**/requirements*.txt', '**/requirements/*.txt') }}"
- name: "Set up buildx"
uses: "docker/setup-buildx-action@v2"
id: buildx
with:
install: true
- name: "Set up docker cache"
uses: "actions/cache@v3"
with:
path: /tmp/.docker-cache-old
key: ${{ runner.os }}-docker-${{ matrix.rule }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-docker-${{ matrix.rule }}-
${{ runner.os }}-docker-
- name: "Build archivematica-tests image"
uses: "docker/build-push-action@v4"
with:
context: .
file: ./hack/Dockerfile
target: archivematica-tests
tags: archivematica-tests:latest
push: false
load: true
cache-from: type=local,src=/tmp/.docker-cache-old
cache-to: type=local,dest=/tmp/.docker-cache-new,mode=max
- name: "Create external volumes"
run: |
make -C hack/ create-volumes
- name: "Run make rule"
if: "! matrix.coverage"
run: |
make -C hack/ test-${{ matrix.rule }}
env:
TOXARGS: -vv
PYTEST_ADDOPTS: -vv
- name: "Run make rule with coverage"
if: "matrix.coverage"
run: |
make -C hack/ test-${{ matrix.rule }}
env:
TOXARGS: -vv
PYTEST_ADDOPTS: -vv --cov /src/src/ --cov-config=/src/.coveragerc --cov-report xml:/src/coverage.xml
- name: "Upload coverage report"
if: matrix.coverage && github.repository == 'artefactual/archivematica'
uses: "codecov/codecov-action@v3"
with:
files: ./coverage.xml
fail_ci_if_error: true
verbose: true
name: ${{ matrix.rule }}
- name: "Set newest docker cache"
run: |
rm -rf /tmp/.docker-cache-old
mv /tmp/.docker-cache-new /tmp/.docker-cache-old
frontend:
name: "Test frontend"
runs-on: "ubuntu-22.04"
defaults:
run:
working-directory: "./src/dashboard/frontend/"
steps:
- name: "Check out repository"
uses: "actions/checkout@v3"
- name: "Set up Node JS"
uses: "actions/setup-node@v3"
with:
node-version: "8"
- name: "Cache npm packages"
uses: "actions/cache@v3"
with:
path: "~/.npm"
key: "${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}"
restore-keys: |
${{ runner.os }}-node-
- name: "Install frontend dependencies"
run: |
npm install
- name: "Run tests"
run: |
npm run "test-single-run"
linting:
name: "Lint"
runs-on: "ubuntu-22.04"
steps:
- name: "Check out repository"
uses: "actions/checkout@v3"
- name: "Set up Python 3.7"
uses: "actions/setup-python@v4"
with:
python-version: "3.7"
- name: "Install tox"
run: |
python -m pip install --upgrade pip
pip install tox
- name: "Run tox"
run: |
tox -e linting