楽観同時実行制御・認可を行うサンプルアプリ(Dressca Admin)を追加する #29
Workflow file for this run
This file contains 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: dressca-admin-frontend CI | |
on: | |
pull_request: | |
branches: [main] | |
paths: | |
- 'samples/web-csr/dressca-frontend/*.*' | |
- 'samples/web-csr/dressca-frontend/admin/**' | |
- '.github/workflows/samples-dressca-admin-frontend.ci.yml' | |
workflow_dispatch: | |
defaults: | |
run: | |
working-directory: samples/web-csr/dressca-frontend/ | |
jobs: | |
build: | |
name: Dressca 管理のフロントエンドアプリケーションのビルド | |
runs-on: ubuntu-latest | |
env: | |
NO_COLOR: "1" # 文字化け防止のためカラーコードを出力しない | |
strategy: | |
matrix: | |
node-version: [20.x] | |
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/ | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- uses: actions/cache@v4 | |
id: node_modules_cache_id | |
env: | |
cache-name: cache-node-modules | |
with: | |
path: '**/node_modules' | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | |
- name: node パッケージのキャッシュ確認 | |
run: echo '${{ toJSON(steps.node_modules_cache_id.outputs) }}' | |
- name: node パッケージのインストール | |
if: ${{ steps.node_modules_cache_id.outputs.cache-hit != 'true' }} | |
run: npm ci | |
- id: run-lint | |
name: lintの実行 | |
run: npm run lint:ci:admin >> /var/tmp/lint-result.txt 2>&1 | |
- id: run-type-check | |
name: TypeScript の型チェック | |
run: npm run type-check:admin >> /var/tmp/type-check-result.txt 2>&1 | |
- id: application-build | |
name: アプリケーションのビルド | |
run: npm run build-only:dev:admin >> /var/tmp/build-result.txt 2>&1 | |
- id: run-unit-tests | |
name: 単体テストの実行 | |
run: npm run test:unit:admin >> /var/tmp/unit-test-result.txt 2>&1 | |
- name: lintの結果出力 | |
if: ${{ success() || (failure() && steps.run-lint.conclusion == 'failure') }} | |
uses: ./.github/workflows/file-to-summary | |
with: | |
body: /var/tmp/lint-result.txt | |
header: 'lintの結果 :pen:' | |
- name: 型チェックの結果出力 | |
if: ${{ success() || (failure() && steps.run-type-check.conclusion == 'failure') }} | |
uses: ./.github/workflows/file-to-summary | |
with: | |
body: /var/tmp/type-check-result.txt | |
header: '型チェックの結果 :pencil2:' | |
- name: ビルドの結果出力 | |
if: ${{ success() || (failure() && steps.application-build.conclusion == 'failure') }} | |
uses: ./.github/workflows/file-to-summary | |
with: | |
body: /var/tmp/build-result.txt | |
header: 'ビルドの結果 :gear:' | |
- name: 単体テストの結果出力 | |
if: ${{ success() || (failure() && steps.run-unit-tests.conclusion == 'failure') }} | |
uses: ./.github/workflows/file-to-summary | |
with: | |
body: /var/tmp/unit-test-result.txt | |
header: '単体テストの結果 :memo:' |