diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..c2bd0ba --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,19 @@ +# 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: "github-actions" # See documentation for possible values + directory: "/" # Location of package manifests + schedule: + interval: "weekly" + - package-ecosystem: "composer" # See documentation for possible values + directory: "/" # Location of package manifests + schedule: + interval: "weekly" + - package-ecosystem: "pip" # See documentation for possible values + directory: "/tests-qa/" # Location of package manifests + schedule: + interval: "weekly" diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml new file mode 100644 index 0000000..fc7256f --- /dev/null +++ b/.github/workflows/docker-build.yml @@ -0,0 +1,44 @@ +name: docker-build + +on: + schedule: + - cron: "0 10 * * *" + push: + branches: + - "*" + tags: + - "*" + workflow_dispatch: + +env: + IMAGE_NAME: geokrety/selenoid-image-firefox + +jobs: + docker: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Check for existing website-base image for current branch + if: "${{ !startsWith(github.ref, 'refs/tags/v') }}" + id: existing-image + run: | + if docker pull ${{ env.IMAGE_NAME }}:${{ github.ref_name }}; then + echo "exists=true" >> $GITHUB_OUTPUT + else + echo "exists=false" >> $GITHUB_OUTPUT + fi + + - name: Override base image tag from branch name + if: "${{ !startsWith(github.ref, 'refs/tags/v') && steps.existing-image.outputs.exists == 'true' }}" + run: | + sed -i "s/^ARG BASE_TAG=.*$/ARG BASE_TAG=${{ github.ref_name }}/" Dockerfile.* + + - uses: geokrety/geokrety-gha-workflows/.github/actions/docker-build@main + with: + image_name: ${{ env.IMAGE_NAME }} + dockerhub_username: ${{ vars.DOCKERHUB_USERNAME }} + dockerhub_token: ${{ secrets.DOCKERHUB_TOKEN }} + dockerfile: Dockerfile.firefox diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml new file mode 100644 index 0000000..fbcf1f1 --- /dev/null +++ b/.github/workflows/pre-commit.yml @@ -0,0 +1,19 @@ +name: pre-commit + +on: + pull_request: + branches-ignore: + - main + - master + - l10n_master + - l10n_new-theme + push: + branches-ignore: + - main + - master + - l10n_master + - l10n_new-theme + +jobs: + lint: + uses: geokrety/geokrety-gha-workflows/.github/workflows/pre-commit.yml@main diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..b439824 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,33 @@ +name: Automatic release + +on: +# push: +# branches: +# - main + workflow_dispatch: + +env: + IMAGE_NAME: geokrety/selenoid-image-firefox + +jobs: + pre-commit: + uses: geokrety/geokrety-gha-workflows/.github/workflows/pre-commit.yml@main + + docker: + uses: geokrety/geokrety-gha-workflows/.github/workflows/docker-build.yml@main + needs: pre-commit + with: + image_name: ${{ env.IMAGE_NAME }} + dockerhub_username: ${{ vars.DOCKERHUB_USERNAME }} + dockerfile: Dockerfile.firefox + secrets: + dockerhub_token: ${{ secrets.DOCKERHUB_TOKEN }} + + build-release: + uses: geokrety/geokrety-gha-workflows/.github/workflows/semantic-release.yml@main + needs: + - docker + # # Uncomment to set mandatory + # - integration-tests + secrets: + GH_TOKEN: ${{ secrets.GH_TOKEN }} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..8c43f2a --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,23 @@ +# See https://pre-commit.com for more information +# See https://pre-commit.com/hooks.html for more hooks +exclude: | + (?x)( + ^vendor/ + ) + +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.5.0 + hooks: + - id: trailing-whitespace + - id: end-of-file-fixer + - id: check-yaml + - id: check-added-large-files + - id: check-json + - id: pretty-format-json + args: ["--autofix"] + + - repo: https://github.com/Lucas-C/pre-commit-hooks + rev: v1.1.9 + hooks: + - id: remove-crlf diff --git a/Dockerfile.firefox b/Dockerfile.firefox new file mode 100644 index 0000000..76e0ab0 --- /dev/null +++ b/Dockerfile.firefox @@ -0,0 +1,13 @@ +ARG BASE_TAG=latest +FROM selenoid/firefox:$BASE_TAG + +USER root + +RUN apt-get update \ + && apt-get install -y \ + fonts-urw-base35 \ + ttf-bitstream-vera \ + && apt-get clean \ + && rm -r /var/lib/apt/lists/* + +USER selenium