diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 000000000..14206b48f --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,11 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file + +version: 2 +updates: + - package-ecosystem: "composer" # See documentation for possible values + directory: "/" # Location of package manifests + schedule: + interval: "weekly" diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 782db6761..fc593cf46 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,32 +1,60 @@ name: test suite -on: [push, pull_request] +on: + push: + branches: + - master + pull_request: jobs: tests: runs-on: self-hosted + container: ubuntu:noble + services: + mysql: + image: mysql:8 + env: + MYSQL_ALLOW_EMPTY_PASSWORD: false + MYSQL_ROOT_PASSWORD: root + MYSQL_PASSWORD: root + MYSQL_DATABASE: gallery3 +# ports: +# - 3306:3306 + options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 strategy: fail-fast: false matrix: - php-versions: ['7.4', '8.0', '8.1'] + php-versions: ['7.4'] env: DB_DATABASE: gallery3 DB_USER: root DB_PASSWORD: root DB_PORT: 3306 - DB_HOST: 127.0.0.1 + DB_HOST: mysql + ACTIONS_RESULTS_URL: http://host.docker.internal:3000 steps: - - name: Install OS packages - run: sudo apt-get install -y imagemagick graphicsmagick dcraw ffmpeg git + - name: env + run: env - - name: Checkout - uses: actions/checkout@v7 + - name: Cache APT Packages + uses: actions/cache@v5 + id: apt-cache + with: + path: /var/cache/apt/archives + key: ${{ runner.os }}-apt-cache-${{ hashFiles('.github/workflows/tests.yml') }} + restore-keys: | + ${{ runner.os }}-apt-cache- - - name: Set up MySQL + - name: Configure APT Keep-Cache run: | - sudo /etc/init.d/mysql start - mysql -e 'CREATE DATABASE ${{ env.DB_DATABASE }};' -u${{ env.DB_USER }} -p${{ env.DB_PASSWORD }} - mysql -e 'CREATE DATABASE ${{ env.DB_DATABASE }}_test;' -u${{ env.DB_USER }} -p${{ env.DB_PASSWORD }} + echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache + # Optional: Remove Docker's default auto-clean directive if present + rm -f /etc/apt/apt.conf.d/docker-clean + + - name: Install OS packages + run: | + apt-get update + apt-get install -y imagemagick graphicsmagick dcraw ffmpeg git mysql-client - name: Setup PHP uses: shivammathur/setup-php@v2 @@ -36,6 +64,12 @@ jobs: ini-values: post_max_size=256M, max_execution_time=180 tools: composer:v2 + - name: Checkout + uses: actions/checkout@v7 + + - name: Set up MySQL + run: | + mysql -e 'CREATE DATABASE ${{ env.DB_DATABASE }}_test;' -h ${{ env.DB_HOST }} --port ${{ env.DB_PORT }} -u${{ env.DB_USER }} -p${{ env.DB_PASSWORD }} - name: Get composer cache directory id: composer-cache run: |