diff --git a/.github/workflows/test_job.yml b/.github/workflows/test_job.yml index da26f1ef..13e9f9e6 100644 --- a/.github/workflows/test_job.yml +++ b/.github/workflows/test_job.yml @@ -16,23 +16,15 @@ jobs: - name: Set up services run: docker-compose up -d --remove-orphans - name: Create conda env - uses: conda-incubator/setup-miniconda@v2 + # https://github.com/marketplace/actions/setup-micromamba + uses: mamba-org/setup-micromamba@v1 with: - activate-environment: freva-web + environment-name: freva-web environment-file: conda-env.yml - python-version: "3.11" - auto-activate-base: false - - name: Run checks in python - run: make tests - - name: Lint python - run: make lint - - name: Prepare node - run: npm install - - name: Lint js formatting - run: npm run lint-format - - name: Lint javascript - run: npm run lint - - name: Test building the prod system - run: npm run build-production - - name: Test building the dev system - run: npm run build + cache-environment: false + cache-downloads: false + init-shell: bash + - name: Lint js code and python + run: micromamba run -n freva-web make lint + - name: Run build checks for js and python smoke tests + run: micromamba run -n freva-web make tests diff --git a/Makefile b/Makefile index d6c29552..17434489 100644 --- a/Makefile +++ b/Makefile @@ -23,7 +23,6 @@ setup-django: setup-node: npm install - runserver: @echo "Starting Django development server..." python manage.py runserver > runserver.log 2>&1 & @@ -51,9 +50,13 @@ setup: setup-node setup-django dummy-data run: runfrontend runserver -lint: +lint: setup-node + npm run lint-format + npm run lint black -t py310 --check . -tests: +tests: setup-node + npm run build-production + npm run build rm -rf node_modules pytest -vv $(PWD) tests/