build: also build redwood branch on CI #67
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
pull_request: | |
push: | |
branches: | |
- master | |
- main | |
jobs: | |
ci: | |
name: Run tests and linting | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
include: | |
- ecommerce_repository: fccn/ecommerce | |
ecommerce_ref: nau/nutmeg.master | |
pip_constraint: pip<24.1 | |
python_version: 3.8 | |
- ecommerce_repository: fccn/ecommerce | |
ecommerce_ref: nau/redwood.master | |
pip_constraint: | |
# https://github.com/overhangio/tutor-ecommerce/blob/de58c6d53a30b3e61bb4fed899ffe15a363014c8/tutorecommerce/templates/ecommerce/build/ecommerce/Dockerfile#L49C20-L49C26 | |
python_version: 3.12.2 | |
steps: | |
- name: Checkout Ecommerce NAU extensions | |
uses: actions/checkout@v4 | |
with: | |
# Relative path to place the repository | |
path: ecommerce-nau-extensions | |
- name: Checkout ecommerce | |
uses: actions/checkout@v4 | |
with: | |
# Repository name with owner | |
repository: ${{ matrix.ecommerce_repository }} | |
# Change the branch to checkout | |
ref: ${{ matrix.ecommerce_ref }} | |
# Relative path to place the repository | |
path: ecommerce | |
- name: Use Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '${{ matrix.python_version }}' | |
cache: 'pip' # caching pip dependencies | |
- name: Install specific pip version | |
if: "${{ matrix.pip_constraint != '' }}" | |
# Requested celery==4.4.7 from https://files.......... (from -r ecommerce/requirements/dev.txt (line 73)) has invalid metadata: Expected matching RIGHT_PARENTHESIS for LEFT_PARENTHESIS, after version specifier | |
# pytz (>dev) | |
# ~^ | |
# Please use pip<24.1 if you need to use this version. | |
run: pip install "${{ matrix.pip_constraint }}" | |
- name: Install ecommerce pip requirements | |
run: pip install -r ecommerce/requirements/dev.txt | |
- name: Install Ecommerce NAU extensions | |
run: pip install -e ecommerce-nau-extensions | |
- name: Run unit tests | |
run: ECOMMERCE_SOURCE_PATH=../ecommerce make -C ecommerce-nau-extensions test | |
- name: Run lint | |
run: ECOMMERCE_SOURCE_PATH=../ecommerce make -C ecommerce-nau-extensions lint | |
- name: Install gettext package | |
run: sudo apt-get install -y gettext | |
- name: Extract translations and detect changed source translations | |
run: make -C ecommerce-nau-extensions extract_translations detect_changed_source_translations |