From b5b09253eeb48640b88414b6f57ab58ad51a723a Mon Sep 17 00:00:00 2001 From: Luca Tumedei Date: Mon, 2 Oct 2023 09:45:10 +0200 Subject: [PATCH] build(.github) add windows build action --- .github/workflows/docs.yml | 31 --------- .github/workflows/spelling.yml | 31 --------- .github/workflows/static-analysis.yml | 53 --------------- .github/workflows/test-on-windows.yml | 50 ++++++++++++++ .github/workflows/test.yaml | 93 --------------------------- 5 files changed, 50 insertions(+), 208 deletions(-) delete mode 100644 .github/workflows/docs.yml delete mode 100644 .github/workflows/spelling.yml delete mode 100644 .github/workflows/static-analysis.yml create mode 100644 .github/workflows/test-on-windows.yml delete mode 100644 .github/workflows/test.yaml diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml deleted file mode 100644 index f25f25d8c..000000000 --- a/.github/workflows/docs.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: docs -on: - push: - paths: - - 'docs/**' - - mkdocs.yml - branches: - - master -permissions: - contents: write -jobs: - deploy: - runs-on: ubuntu-latest - if: github.event.repository.fork == false - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v4 - with: - python-version: 3.x - - run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV - - uses: actions/cache@v3 - with: - key: mkdocs-material-${{ env.cache_id }} - path: .cache - restore-keys: | - mkdocs-material- - - run: sudo apt-get install pngquant - - run: pip install git+https://${MKDOCS_GH_TOKEN}@github.com/squidfunk/mkdocs-material-insiders.git pillow - - run: mkdocs gh-deploy --force -env: - MKDOCS_GH_TOKEN: ${{ secrets.MKDOCS_GH_TOKEN }} diff --git a/.github/workflows/spelling.yml b/.github/workflows/spelling.yml deleted file mode 100644 index 4cc6bee3d..000000000 --- a/.github/workflows/spelling.yml +++ /dev/null @@ -1,31 +0,0 @@ -# yaml-language-server: $schema=https://json.schemastore.org/github-workflow - -name: "Spelling" - -on: # yamllint disable-line rule:truthy - pull_request: null - push: - branches: - - "master" - -permissions: - contents: "read" - -concurrency: - group: "${{ github.workflow }}-${{ github.ref }}" - cancel-in-progress: true - -jobs: - typos_check: - name: "文A Typos check" - runs-on: "ubuntu-22.04" - timeout-minutes: 1 - steps: - - - name: "Checkout repository" - uses: "actions/checkout@v3" - - - name: "Search for misspellings" - uses: "crate-ci/typos@master" - with: - config: ./config/typos.toml diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml deleted file mode 100644 index 58f499712..000000000 --- a/.github/workflows/static-analysis.yml +++ /dev/null @@ -1,53 +0,0 @@ -# yaml-language-server: $schema=https://json.schemastore.org/github-workflow - -name: "Static Analysis" - -on: # yamllint disable-line rule:truthy - pull_request: null - push: - paths: - - "src/**" - - "includes/**" - - "tests/**" - - "composer.json" - branches: - - "master" - -permissions: - contents: "read" - -concurrency: - group: "${{ github.workflow }}-${{ github.ref }}" - cancel-in-progress: true - -jobs: - static_analysis: - name: "Static Analysis" - runs-on: "ubuntu-22.04" - steps: - - - name: "Set up PHP" - uses: "shivammathur/setup-php@v2" - with: - php-version: "8.0" - coverage: "none" - - - name: "Checkout repository" - uses: "actions/checkout@v3" - - - name: "Validate Composer configuration" - run: "composer validate --no-interaction --strict" - - - name: "Install dependencies" - uses: "ramsey/composer-install@v2" - with: - dependency-versions: "highest" - - - name: "Check PSR-4 mapping" - run: "composer dump-autoload --no-interaction --optimize --strict-psr" - - - name: "Run PHPHStan" - run: "composer run stan" - - - name: "Run PHP Code Sniffer" - run: "composer run cs" diff --git a/.github/workflows/test-on-windows.yml b/.github/workflows/test-on-windows.yml new file mode 100644 index 000000000..958ff4706 --- /dev/null +++ b/.github/workflows/test-on-windows.yml @@ -0,0 +1,50 @@ +# yaml-language-server: $schema=https://json.schemastore.org/github-workflow + +name: Test (Windows) + +on: # yamllint disable-line rule:truthy + pull_request: null + push: + paths: + - "src/**" + - "includes/**" + - "tests/**" + - "composer.json" + branches: + - "master" + +permissions: + contents: "read" + +concurrency: + group: "${{ github.workflow }}-${{ github.ref }}" + cancel-in-progress: true + +jobs: + test-windows: + strategy: + matrix: + suite: + - acceptance + - climodule + - functional + - muloader + - unit + - webdriver + - wpcli_module + - wploader_multisite + - wploader_wpdb_interaction + - wploadersuite + name: ${{ matrix.suite }} (Windows) + runs-on: windows-2022 + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php_version }} + extensions: uopz, sqlite3, gd + ini-values: post_max_size=256M, max_execution_time=180, uopz.exit=1 + tools: composer diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml deleted file mode 100644 index 888d47562..000000000 --- a/.github/workflows/test.yaml +++ /dev/null @@ -1,93 +0,0 @@ -# yaml-language-server: $schema=https://json.schemastore.org/github-workflow - -name: Test - -on: # yamllint disable-line rule:truthy - pull_request: null - push: - paths: - - "src/**" - - "includes/**" - - "tests/**" - - "composer.json" - branches: - - "master" - -permissions: - contents: "read" - -concurrency: - group: "${{ github.workflow }}-${{ github.ref }}" - cancel-in-progress: true - -jobs: - test: - strategy: - matrix: - php_version: [ '8.0', '8.1', '8.2' ] - suite: - - acceptance - - climodule - - functional - - muloader - - unit - - webdriver - - wpcli_module - - wploader_multisite - - wploader_wpdb_interaction - - wploadersuite - name: ${{ matrix.suite }} php@${{ matrix.php_version }} - runs-on: ubuntu-22.04 - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php_version }} - extensions: uopz, sqlite3, gd - ini-values: post_max_size=256M, max_execution_time=180, uopz.exit=1 - tools: composer - - - name: Get Composer Cache Directory - id: composer-cache - run: | - echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT - - - name: Restore Composer dependencies - uses: actions/cache@v3 - with: - path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-composer-${{ matrix.php_version }}-${{ hashFiles('**/composer.lock') }} - restore-keys: | - ${{ runner.os }}-composer- - - - name: Install dependencies - run: composer update - - - name: Update ChromeDriver - run: vendor/bin/codecept chromedriver:update --binary /usr/bin/google-chrome - - - name: Create var/wordpress directory - run: mkdir -p var/wordpress - - - name: Start services - run: vendor/bin/codecept dev:start - - - name: Setup WordPress - run: php bin/setup-wp.php - - - name: Run tests - id: test - run: vendor/bin/codecept run ${{ matrix.suite }} - - - name: Upload Artifacts - uses: actions/upload-artifact@v2 - if: ${{ failure() }} - with: - name: ${{ matrix.suite }}-php@${{ matrix.php_version }}-screenshots - path: | - var/_output/*.html - var/_output/*.png - retention-days: 3