diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0d3afd5..b4ea5bf 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -5,8 +5,11 @@ on: [pull_request] jobs: build: runs-on: ubuntu-latest + strategy: + matrix: + version: [7.4, 8.0, 8.1, 8.2] steps: - - uses: actions/checkout@v2 - with: - ref: ${{ github.event.release.target_commitish }} - - run: docker build . --build-arg PHP_VERSION=8 + - uses: actions/checkout@v2 + with: + ref: ${{ github.event.release.target_commitish }} + - run: docker build . --build-arg PHP_VERSION=${{ matrix.version }} diff --git a/Dockerfile b/Dockerfile index d80e050..d855f0a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ ARG PHP_VERSION FROM php:${PHP_VERSION} as standards-runtime RUN apt-get update -RUN apt-get install -y unzip libpng-dev libicu-dev libxslt-dev jq git libzip-dev wget +RUN apt-get install -y unzip libpng-dev libicu-dev libxslt-dev jq git libzip-dev wget python3-venv RUN apt-get clean RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer @@ -22,6 +22,12 @@ RUN apt-get clean COPY pipe / RUN chmod a+x /pipe.py COPY requirements.txt / -RUN python3 -m pip install --no-cache-dir -r /requirements.txt +RUN python3 -m venv /venv +RUN /venv/bin/pip install --no-cache-dir -r /requirements.txt + +# Allow git access to mounted build directories +RUN git config --global --add safe.directory /build +RUN mkdir -p /opt/atlassian/pipelines/agent/build +RUN git config --global --add safe.directory /opt/atlassian/pipelines/agent/build ENTRYPOINT ["/pipe.py"] diff --git a/pipe/pipe.py b/pipe/pipe.py index 3fd5fc4..c4bc7ab 100644 --- a/pipe/pipe.py +++ b/pipe/pipe.py @@ -1,9 +1,8 @@ -#!/usr/bin/env python3 +#!/venv/bin/python from operator import sub import os import shutil -from sre_constants import SUCCESS import subprocess from sys import stdout import sys