name: Continuous Integration on: [push, pull_request] jobs: build: if: github.repository_owner == 'TandoorRecipes' runs-on: ubuntu-latest strategy: max-parallel: 4 matrix: python-version: ["3.12"] node-version: ["22"] steps: - uses: actions/checkout@v5 - uses: awalsh128/cache-apt-pkgs-action@v1.6.0 with: packages: libsasl2-dev python3-dev libxml2-dev libxmlsec1-dev libxslt-dev libxmlsec1-openssl libxslt-dev libldap2-dev libssl-dev gcc musl-dev postgresql-dev zlib-dev jpeg-dev libwebp-dev openssl-dev libffi-dev cargo openldap-dev python3-dev xmlsec-dev xmlsec build-base g++ curl version: 1.0 # Setup python & dependencies - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v6 with: python-version: ${{ matrix.python-version }} cache: "pip" - name: Install Python Dependencies run: | python -m pip install --upgrade pip pip install -r requirements.txt - name: Cache StaticFiles uses: actions/cache@v4 id: django_cache with: path: | ./cookbook/static ./staticfiles key: | ${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.node-version }}-collectstatic-${{ hashFiles('**/*.css', '**/*.js', 'vue3/src/*') }} # Build Vue frontend & Dependencies - name: Set up Node ${{ matrix.node-version }} if: steps.django_cache.outputs.cache-hit != 'true' uses: actions/setup-node@v6 with: node-version: ${{ matrix.node-version }} cache: "yarn" cache-dependency-path: ./vue3/yarn.lock - name: Install Vue dependencies if: steps.django_cache.outputs.cache-hit != 'true' working-directory: ./vue3 run: yarn install - name: Build Vue dependencies if: steps.django_cache.outputs.cache-hit != 'true' working-directory: ./vue3 run: yarn build - name: Compile Django StaticFiles if: steps.django_cache.outputs.cache-hit != 'true' run: | python3 manage.py collectstatic --noinput - uses: actions/cache/save@v4 if: steps.django_cache.outputs.cache-hit != 'true' with: path: | ./cookbook/static ./staticfiles key: | ${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.node-version }}-collectstatic-${{ hashFiles('**/*.css', '**/*.js', 'vue/src/*') }} - name: Django Testing project run: pytest --junitxml=junit/test-results-${{ matrix.python-version }}.xml