fix #841
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: Check | |
on: pull_request | |
env: | |
TZ: Asia/Tokyo | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
lint: | |
name: Lint | |
runs-on: ubuntu-22.04 | |
timeout-minutes: 5 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '18' | |
- id: yarn-cache-dir-path | |
run: echo "YARN_CACHE_DIR=$(yarn cache dir)" >> $GITHUB_OUTPUT | |
- uses: actions/cache@v3 | |
with: | |
path: ${{ steps.yarn-cache-dir-path.outputs.YARN_CACHE_DIR }} | |
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-yarn- | |
- run: yarn install | |
- run: yarn lint 2>&1 | tee lint.log | |
- run: | | |
RESULT="$(cat "lint.log")" | |
cat << EOF >> "$GITHUB_STEP_SUMMARY" | |
### Result | |
\`\`\` | |
$RESULT | |
\`\`\` | |
EOF | |
build: | |
name: Build | |
runs-on: ubuntu-22.04 | |
timeout-minutes: 5 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '18' | |
- id: yarn-cache-dir-path | |
run: echo "YARN_CACHE_DIR=$(yarn cache dir)" >> $GITHUB_OUTPUT | |
- uses: actions/cache@v3 | |
with: | |
path: ${{ steps.yarn-cache-dir-path.outputs.YARN_CACHE_DIR }} | |
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-yarn- | |
- run: yarn install | |
- run: yarn build | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: build | |
path: ./build/ | |
- run: | | |
FILES="$(du -ach ./build/*)" | |
cat << EOF >> "$GITHUB_STEP_SUMMARY" | |
### Files | |
<details> | |
\`\`\` | |
$FILES | |
\`\`\` | |
</details> | |
EOF | |
test: | |
name: Test | |
runs-on: ubuntu-22.04 | |
timeout-minutes: 5 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '18' | |
- id: yarn-cache-dir-path | |
run: echo "YARN_CACHE_DIR=$(yarn cache dir)" >> $GITHUB_OUTPUT | |
- uses: actions/cache@v3 | |
with: | |
path: ${{ steps.yarn-cache-dir-path.outputs.YARN_CACHE_DIR }} | |
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-yarn- | |
- run: yarn install | |
- run: yarn test | |
- run: | | |
COVERAGE="$(cat "coverage/summary.txt")" | |
DETAILS="$(cat "coverage/details.txt")" | |
cat << EOF >> "$GITHUB_STEP_SUMMARY" | |
### Coverage | |
\`\`\` | |
$COVERAGE | |
\`\`\` | |
### Details | |
<details> | |
\`\`\` | |
$DETAILS | |
\`\`\` | |
</details> | |
EOF | |
e2e: | |
name: E2E Test | |
runs-on: ubuntu-22.04 | |
timeout-minutes: 5 | |
needs: | |
- build | |
- generate_pdf | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/download-artifact@v4 | |
- run: | | |
mkdir -p ./pdf/out | |
mv -v pdf_out/* ./pdf/out | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '18' | |
- id: yarn-cache-dir-path | |
run: echo "YARN_CACHE_DIR=$(yarn cache dir)" >> $GITHUB_OUTPUT | |
- uses: actions/cache@v3 | |
with: | |
path: ${{ steps.yarn-cache-dir-path.outputs.YARN_CACHE_DIR }} | |
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-yarn- | |
- run: yarn install | |
- run: yarn test:e2e | |
generate_pdf: | |
name: Generate PDF | |
runs-on: ubuntu-22.04 | |
timeout-minutes: 5 | |
needs: | |
- build | |
- lint | |
- test | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/download-artifact@v4 | |
- run: ./generate_pdf.bash | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: pdf_out | |
path: ./pdf/out |