Skip to content

vitepress #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: "CI Tests"

on:
pull_request:
push:

env:
fail-fast: true
PHPUNIT_FLAGS: "-v"
SYMFONY_DEPRECATIONS_HELPER: weak

jobs:
build:
runs-on: ubuntu-latest
name: PHP v${{ matrix.php }}, Symfony v${{ matrix.symfony }}
strategy:
fail-fast: false
matrix:
include:
- { php: 8.3, symfony: "6.4.*", composer-flags: '--prefer-stable'}
- { php: 8.2, symfony: "6.4.*", composer-flags: '--prefer-stable' }
- { php: 8.3, symfony: "7.0.*", composer-flags: '--prefer-stable' }

steps:
- uses: actions/checkout@v2
- name: "Installing php"
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: curl,mbstring,xdebug
ini-values: date.timezone="Europe/Paris"
coverage: xdebug
tools: "composer:v2,flex"

- name: Show PHP version
run: php -v && composer -V

- name: Download Composer cache dependencies from cache
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Cache Composer dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ matrix.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ matrix.os }}-composer-

- name: Install dependencies
run: |
perl -pi -e 's/^}$/,"minimum-stability":"dev"}/' composer.json
composer update ${{ matrix.composer-flags }} --prefer-dist
env:
SYMFONY_REQUIRE: "${{ matrix.symfony }}"

- name: "Run PHPUnit Tests"
run: "composer test"
64 changes: 64 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Sample workflow for building and deploying a VitePress site to GitHub Pages
#
name: Deploy docs site to Pages

on:
# Runs on pushes targeting the `main` branch. Change this to `master` if you're
# using the `master` branch as the default branch.
push:
branches: [main]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: pages
cancel-in-progress: false

jobs:
# Build job
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # Not needed if lastUpdated is not enabled
# - uses: pnpm/action-setup@v3 # Uncomment this if you're using pnpm
# - uses: oven-sh/setup-bun@v1 # Uncomment this if you're using Bun
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm # or pnpm / yarn
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Install dependencies
run: npm ci # or pnpm install / yarn install / bun install
- name: Build with VitePress
run: npm run docs:build # or pnpm docs:build / yarn docs:build / bun run docs:build
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: docs/.vitepress/dist

# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs: build
runs-on: ubuntu-latest
name: Deploy
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
14 changes: 5 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Spiriit Excel Rust
==================

# Rust Excel Library: A High-Performance Solution for Generating Excel Files from PHP
# Supercharge Excel generation in PHP with Rust's blazing speed!

This PHP library leverages the power of Rust to create Excel files quickly and efficiently.

Expand All @@ -26,9 +26,12 @@ Once the data is received, the Rust binary uses the **excelrust** library to cre

## With WorkbookFactory

First create a class implements `ExcelInterface`
First create a class implements `ExcelInterface` and add attribute 'AsExcelRust'

```php
use Spiriit\Rustsheet\Attributes\AsExcelRust;

#[AsExcelRust(outputName: "myexcel.xlsx")] // optionnal outputName
class MyExcel implements ExcelInterface
{
public function buildSheet(WorkbookBuilder $builder): void
Expand Down Expand Up @@ -57,13 +60,6 @@ class MyExcel implements ExcelInterface
),
);
}

public function configureOptions(OptionsResolver $resolver): void
{
$resolver->setDefaults([
'filename' => '/path/to/output/myexcel.xlsx', // path where file will be generated
]);
}
}
```

Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"symfony/options-resolver": "5.4 | 6.4 | 7.*",
"psr/log": "^3.0",
"symfony/framework-bundle": "6.4 | 7.*",
"symfony/string": "6.4 | 7.*"
"symfony/string": "6.4 | 7.*",
"webmozart/assert": "^1.11"
},
"require-dev": {
"phpunit/phpunit": "10.*",
Expand Down
1 change: 1 addition & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
Loading
Loading