diff --git a/.github/workflows/build-gitlab-container-PR.yml b/.github/workflows/build-gitlab-container-PR.yml index c9159f29..b2e78778 100644 --- a/.github/workflows/build-gitlab-container-PR.yml +++ b/.github/workflows/build-gitlab-container-PR.yml @@ -19,13 +19,14 @@ jobs: packages: write contents: read steps: - - uses: actions/checkout@v4 + - name: Checkout + uses: actions/checkout@v4 - name: Use the same PHP config as the contributor containers run: cp -r docker-{contributor,gitlabci}/php-config - name: Log in to GitHub Container registry (possibly at fork) - uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 + uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.actor }} @@ -33,12 +34,12 @@ jobs: - name: Extract metadata (tags, labels) for Docker id: meta - uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 + uses: docker/metadata-action@v5 with: images: ghcr.io/${{ github.repository }} - name: Build and push Docker images - uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 + uses: docker/build-push-action@v5 with: context: "./docker-gitlabci" push: true diff --git a/.github/workflows/build-gitlab-container-release.yml b/.github/workflows/build-gitlab-container-release.yml index 39191124..f927a461 100644 --- a/.github/workflows/build-gitlab-container-release.yml +++ b/.github/workflows/build-gitlab-container-release.yml @@ -1,6 +1,8 @@ name: 'Build GitLab CI container (Release)' on: + schedule: + - cron: "4 3 * * 5" push: branches: - main @@ -14,26 +16,26 @@ jobs: packages: write contents: read steps: - - uses: actions/checkout@v4 + - name: Checkout + uses: actions/checkout@v4 - name: Use the same PHP config as the contributor containers run: cp -r docker-{contributor,gitlabci}/php-config - name: Log in to Docker Container registry - if: github.ref == 'refs/heads/main' - uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 + uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Extract metadata (tags, labels) for Docker id: meta - uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 + uses: docker/metadata-action@v5 with: images: domjudge/gitlabci - name: Build and push Docker images - uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 + uses: docker/build-push-action@v5 with: context: "./docker-gitlabci" push: true diff --git a/docker-gitlabci/Dockerfile b/docker-gitlabci/Dockerfile index 81d43e70..58775246 100644 --- a/docker-gitlabci/Dockerfile +++ b/docker-gitlabci/Dockerfile @@ -1,44 +1,29 @@ -FROM ubuntu:22.04 +FROM ubuntu:24.04 ENV DEBIAN_FRONTEND=noninteractive -ENV PHPSUPPORTED="7.2 7.3 8.0 8.1 8.2" +ENV PHPSUPPORTED="7.4 8.0 8.2 8.3" ENV APTINSTALL="apt install -y -o Dpkg::Options::=--force-confdef -o Dpkg::Options::=--force-confold" RUN apt update && apt install -y \ acl make zip unzip apache2-utils bsdmainutils libcurl4-gnutls-dev \ libjsoncpp-dev libmagic-dev autoconf automake bats sudo debootstrap procps \ gcc g++ default-jre-headless default-jdk ghc fp-compiler libcgroup-dev \ - devscripts shellcheck nginx libboost-regex-dev \ - php8.1 php8.1-cli php8.1-gd php8.1-curl php8.1-mysql php8.1-gmp php8.1-zip php8.1-xml php8.1-mbstring php8.1-fpm php8.1-intl php8.1-pcov \ - # W3c test \ - httrack \ - # Visual regression browser \ - cutycapt xvfb openimageio-tools imagemagick \ + devscripts shellcheck nginx libboost-regex-dev composer codespell \ + php8.3 php8.3-cli php8.3-gd php8.3-curl php8.3-mysql php8.3-gmp php8.3-zip php8.3-xml php8.3-mbstring php8.3-fpm php8.3-intl php8.3-pcov \ # Submit client \ python3-requests python3-magic \ # Docs \ python3-sphinx python3-sphinx-rtd-theme rst2pdf fontconfig python3-yaml \ - texlive-latex-recommended texlive-latex-extra \ - texlive-fonts-recommended texlive-lang-european latexmk \ + texlive-latex-recommended texlive-latex-extra texlive-lang-european latexmk \ # Misc gitlab things \ mariadb-client curl build-essential packaging-dev \ git python3-pip moreutils w3m python3-yaml \ # Things we'd have in the chroot \ - ca-certificates default-jre-headless pypy locales software-properties-common \ + ca-certificates default-jre-headless pypy3 locales software-properties-common \ # W3c WCAG \ - npm libnss3 libcups2 libxss1 libasound2 libatk1.0-0 libatk-bridge2.0-0 libpangocairo-1.0-0 libgtk-3-0 \ - # Code coverage for unit test + npm \ + # Code coverage for unit test \ php-pear php-dev \ # Needed NPM packages \ - && npm install -g pa11y \ - # Needed python packages \ - && pip install codespell \ - && rm -rf /var/lib/apt/lists/* - -# Install composer -RUN apt update && \ - apt install --no-install-recommends --no-install-suggests -y ca-certificates \ - && rm -rf /var/lib/apt/lists/* \ - && php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && php composer-setup.php \ - && mv /composer.phar /usr/local/bin/composer + && npm install -g pa11y puppeteer # Install needed global PHP modules RUN composer -n require justinrainbow/json-schema @@ -51,7 +36,8 @@ RUN add-apt-repository ppa:ondrej/php -y && apt update && \ for PACKAGE in $PACKAGES; do \ $APTINSTALL php${VERSION}-${PACKAGE#php*-}; \ done; \ - done && update-alternatives --set php /usr/bin/php8.1 + done && update-alternatives --set php /usr/bin/php8.3 \ + && rm -rf /var/lib/apt/lists/* # Put the gitlab user in sudo RUN echo 'ALL ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers @@ -61,6 +47,14 @@ RUN useradd -d /nonexistent -g nogroup -s /bin/false domjudge-run-0 RUN useradd -d /nonexistent -g nogroup -s /bin/false domjudge-run-1 RUN groupadd domjudge-run +# Download chrome for the domjudge user +RUN su domjudge -c "npx puppeteer browsers install chrome" + +# Update dictionary to latest version +ENV GITHUBDICTIONARY="https://raw.githubusercontent.com/codespell-project/codespell/master/codespell_lib/data/dictionary.txt" +ENV CODESPELLDICTLOCATION="/usr/lib/python3/dist-packages/codespell_lib/data/dictionary.txt" +RUN wget $GITHUBDICTIONARY -O $CODESPELLDICTLOCATION + # Do some extra setup RUN mkdir -p /run/php \ && rm /etc/php/*/fpm/pool.d/www.conf