diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md new file mode 100644 index 0000000..441e906 --- /dev/null +++ b/.github/CONTRIBUTING.md @@ -0,0 +1,17 @@ +# Contributing + +## Issues & Pull Requests + +* Communicate in English on issues and pull requests. +* Pull requests should only contain related changes. +* Changes should always be rebased on `main` +* Your code should follow [our coding standard](https://www.php-fig.org/per/coding-style/). +* Your code should be covered by unit tests. +* All checks must pass before your code is merged. + +--- + +Once your code is merged, it is available to everybody, for free, under the [MIT License](/LICENSE). +By publishing your pull request on the project, you implicitly agree with the aforementioned license. + +**Thank you for your contribution! It wouldn't be so great without you.** \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/BUG.md b/.github/ISSUE_TEMPLATE/BUG.md new file mode 100644 index 0000000..de090d7 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/BUG.md @@ -0,0 +1,38 @@ +--- +name: Bug report +about: Create a report to help us improve +title: "" +labels: "" +assignees: "" +--- + +### Summary + + + +### Versions + + + +| | Version | +| :------------------------------------------ | :------ | +| PHP version | x.y.z | +| `azure-storage-php-adapter-laravel` version | x.y.z | + +### Self-enclosed code snippet for reproduction + +```php +# replace this with a self-enclosed usage example +``` + +### Expected output + +```txt +# replace this with the expected output of your self-enclosed example +``` + +### Actual output + +```txt +# replace this with the actual output of your self-enclosed example +``` diff --git a/.github/SECURITY.md b/.github/SECURITY.md new file mode 100644 index 0000000..f14f97d --- /dev/null +++ b/.github/SECURITY.md @@ -0,0 +1,14 @@ +# Security Policy + +## Supported Versions + +The following versions of `azure-oss/azure-storage-php-adapter-flysystem` have active support: + +| Version | Supported | +|---------|--------------------| +| 1.x | :white_check_mark: | + +## Reporting a Vulnerability + +If you believe that you have found a security vulnerability, please send us a message to get in touch. Ensure to **NOT +INCLUDE** all details required in the public. diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..9b7a45a --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,6 @@ +version: 2 +updates: + - package-ecosystem: "composer" + directory: "/" + schedule: + interval: "weekly" diff --git a/.github/stale.yml b/.github/stale.yml new file mode 100644 index 0000000..72661bc --- /dev/null +++ b/.github/stale.yml @@ -0,0 +1,14 @@ +daysUntilStale: 21 +daysUntilClose: 7 +exemptLabels: + - "pinned" + - "security" +# Label to use when marking an issue as stale +staleLabel: "lifecycle/stale" +# Comment to post when marking an issue as stale. Set to `false` to disable +markComment: > + This issue has been automatically marked as stale because it has not had + recent activity. It will be closed after 1 week if no further activity occurs. Thank you + for your contributions. +# Comment to post when closing a stale issue. Set to `false` to disable +closeComment: false \ No newline at end of file diff --git a/.github/workflows/bc-check.yml b/.github/workflows/bc-check.yml new file mode 100644 index 0000000..9364505 --- /dev/null +++ b/.github/workflows/bc-check.yml @@ -0,0 +1,19 @@ +on: + pull_request: + push: + branches: + - "main" + +name: Breaking Changes + +jobs: + roave-bc-check: + name: Roave BC Check + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Check for breaking changes + run: docker run --env GITHUB_REPOSITORY="Azure-OSS/azure-storage-php-adapter-laravel" -u $(id -u) -v $(pwd):/app nyholm/roave-bc-check-ga diff --git a/.github/workflows/code-coverage.yml b/.github/workflows/code-coverage.yml new file mode 100644 index 0000000..d0f373d --- /dev/null +++ b/.github/workflows/code-coverage.yml @@ -0,0 +1,45 @@ +on: # yamllint disable-line rule:truthy + pull_request: ~ + push: + branches: + - "main" + - "[0-9].*" + +name: "Code Coverage" + +jobs: + code-coverage: + name: "Code Coverage" + + strategy: + matrix: + php-version: + - "8.1" + + services: + azurite: + image: mcr.microsoft.com/azure-storage/azurite + ports: + - 10000:10000 + + runs-on: "ubuntu-latest" + + steps: + - name: "Checkout code" + uses: "actions/checkout@v4" + + - name: "Install PHP with extensions" + uses: "shivammathur/setup-php@v2" + with: + coverage: xdebug + extensions: json curl + php-version: "${{ matrix.php-version }}" + + - name: "Download dependencies" + run: composer install --ansi --no-interaction --no-progress --optimize-autoloader + + - name: "Collect code coverage with PHPUnit" + run: vendor/bin/phpunit --colors=always --coverage-clover=.build/logs/clover.xml + + - name: "Send code coverage report to codecov.io" + run: bash <(curl -s https://codecov.io/bash) diff --git a/.github/workflows/coding-standards.yml b/.github/workflows/coding-standards.yml new file mode 100644 index 0000000..e8ada0e --- /dev/null +++ b/.github/workflows/coding-standards.yml @@ -0,0 +1,42 @@ +on: + pull_request: ~ + push: + branches: + - "main" + +name: Coding Standards + +permissions: write-all + +jobs: + pint: + name: Check & fix styling + + runs-on: ubuntu-latest + + strategy: + matrix: + php-version: + - 8.1 # Always run on the lowest supported version due to compatibility + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-version }} + extensions: curl json + coverage: none + + - name: Download dependencies + run: composer install --no-interaction --no-progress --optimize-autoloader + + - name: Run laravel/pint + run: vendor/bin/pint + + - name: Commit linted files + uses: stefanzweifel/git-auto-commit-action@v5 + with: + commit_message: "Fixes coding style" diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml new file mode 100644 index 0000000..e2e199e --- /dev/null +++ b/.github/workflows/static-analysis.yml @@ -0,0 +1,33 @@ +on: + pull_request: ~ + push: + branches: + - "main" + +name: Static analysis + +jobs: + phpstan: + name: PHPStan + runs-on: ubuntu-latest + + strategy: + matrix: + php-version: [8.1] + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-version }} + extensions: curl json + coverage: none + + - name: Download dependencies + run: composer install --no-interaction --no-progress --optimize-autoloader + + - name: Run PHPStan + run: vendor/bin/phpstan --no-progress --memory-limit=2G diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..e00f6fa --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,46 @@ +on: + pull_request: + push: + branches: + - "main" + +name: Tests + +jobs: + phpunit: + name: PHPUnit on ${{ matrix.operating-system }} with PHP ${{ matrix.php-version }} + + strategy: + matrix: + operating-system: + - 'ubuntu-latest' + php-version: + - '8.1' + - '8.2' + - '8.3' + - '8.4' + + services: + azurite: + image: mcr.microsoft.com/azure-storage/azurite + ports: + - 10000:10000 + + runs-on: ${{ matrix.operating-system }} + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Install PHP with extensions + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-version }} + extensions: curl json + coverage: none + + - name: Download dependencies + run: composer install --no-interaction --no-progress --optimize-autoloader + + - name: Run tests + run: ./vendor/bin/phpunit