feat: 商品一覧からバーコード印刷用PDFファイルを出力機能 #9
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build and Test | |
| on: | |
| push: | |
| branches: [ master ] | |
| pull_request: | |
| branches: [ master ] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Set up JDK 11 | |
| uses: actions/setup-java@v3 | |
| with: | |
| java-version: '11' | |
| distribution: 'temurin' | |
| cache: gradle | |
| - name: Grant execute permission for gradlew | |
| run: chmod +x gradlew | |
| - name: Build with Gradle | |
| run: ./gradlew build | |
| - name: Test with Gradle | |
| run: ./gradlew test | |
| - name: Publish Test Results | |
| uses: EnricoMi/publish-unit-test-result-action@v2 | |
| if: always() | |
| with: | |
| files: build/test-results/**/*.xml | |
| optimize-test: | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Set up JDK 11 | |
| uses: actions/setup-java@v3 | |
| with: | |
| java-version: '11' | |
| distribution: 'temurin' | |
| cache: gradle | |
| - name: Grant execute permission for gradlew | |
| run: chmod +x gradlew | |
| - name: Create SQLite test database | |
| run: | | |
| sudo apt-get update && sudo apt-get install -y sqlite3 | |
| sqlite3 test.db "CREATE TABLE item (id INTEGER PRIMARY KEY, barcode TEXT, name TEXT, price INTEGER); | |
| CREATE TABLE sale (id INTEGER PRIMARY KEY, storeId INTEGER, staffId INTEGER, quantity INTEGER, amount INTEGER, deposit INTEGER, createdAt TEXT); | |
| CREATE TABLE sale_detail (id INTEGER PRIMARY KEY, saleId INTEGER, itemId INTEGER, price INTEGER, quantity INTEGER); | |
| INSERT INTO item VALUES (1, 'test-barcode', 'Test Item', 100); | |
| INSERT INTO item VALUES (2, 'test-barcode-2', 'Test Item 2', 200);" | |
| - name: Test database optimization | |
| run: | | |
| echo "Running SQLite optimization test..." | |
| sqlite3 test.db "CREATE INDEX idx_item_barcode ON item(barcode); | |
| ANALYZE; | |
| EXPLAIN QUERY PLAN SELECT * FROM item WHERE barcode = 'test-barcode';" > optimization_result.txt | |
| cat optimization_result.txt | |
| if ! grep -q "SEARCH TABLE item USING INDEX idx_item_barcode" optimization_result.txt; then | |
| echo "Optimization test failed: Index not used in query plan" | |
| exit 1 | |
| fi |