Merge pull request #1163 from dddjava/dependabot/gradle/io.swagger.co… #1168
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: Main Upkeep | |
| on: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| build: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ ubuntu-latest, windows-latest ] | |
| java-version: [ '21' ] | |
| name: build Java ${{ matrix.java-version }} (${{ matrix.os }}) | |
| env: | |
| GRADLE_OPTS: '-Dorg.gradle.daemon=false -Dfile.encoding=UTF-8' | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: actions/setup-java@v5.6.0 | |
| with: | |
| distribution: 'temurin' | |
| # 25はfixtureを最新LTSのクラスファイルへコンパイルするために使う | |
| java-version: | | |
| 25 | |
| ${{ matrix.java-version }} | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v6.2.0 | |
| with: | |
| # デフォルトのenhanced(closed-source) providerはWindowsでキャッシュ保存が | |
| # 常に失敗する既知不具合があるため、OSS実装のbasic providerを使う | |
| # https://github.com/gradle/actions/issues/1013 | |
| cache-provider: ${{ runner.os == 'Windows' && 'basic' || 'enhanced' }} | |
| - name: Set UTF-8 encoding for Windows | |
| if: runner.os == 'Windows' | |
| run: chcp.com 65001 | |
| - name: Run Build | |
| # CLIの起動契約はOS差が出るため、mainではWindowsでもE2Eまで動かす | |
| run: | | |
| ./gradlew build qualityCheck --continue | |
| - name: Set up Node.js | |
| # 生成サイトを読むContractはubuntuだけで行う | |
| if: runner.os == 'Linux' | |
| uses: actions/setup-node@v7.0.0 | |
| with: | |
| node-version: '24' | |
| cache: 'npm' | |
| - name: Run JS contract tests | |
| # 入力はビルドが出力した生成サイトなので、Gradle のビルドより後に実行する | |
| if: runner.os == 'Linux' | |
| run: | | |
| npm ci | |
| npm run test:contract:js | |
| - name: Upload test failure report | |
| uses: actions/upload-artifact@v7 | |
| if: failure() | |
| with: | |
| name: test-failure-reports-${{ matrix.java-version }}-${{ runner.os }} | |
| path: jig-*/build/reports/tests/ | |
| retention-days: 3 | |
| js-test: | |
| # JavaScript のテストはubuntuだけで行う | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v7.0.0 | |
| with: | |
| node-version: '24' | |
| cache: 'npm' | |
| - name: Install JS dependencies | |
| run: npm ci | |
| - name: Run JS tests | |
| run: npm run test | |
| - name: Run stylelint | |
| run: npm run lint:css | |
| deploy-pages: | |
| needs: [ build, js-test ] | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: actions/setup-java@v5.6.0 | |
| with: | |
| distribution: 'temurin' | |
| java-version: | | |
| 25 | |
| 21 | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v6.2.0 | |
| - name: Build classes | |
| run: ./gradlew build -x test | |
| - name: Download latest JIG CLI | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: gh release download --pattern jig-cli.jar | |
| - name: Run JIG | |
| run: java -jar jig-cli.jar | |
| - name: Deploy to gh-pages | |
| uses: JamesIves/github-pages-deploy-action@v4 | |
| with: | |
| branch: gh-pages | |
| folder: build/jig | |
| clean-exclude: '.circleci/config.yml' |