Merge pull request #34 from saiichihashimoto/dependabot/npm_and_yarn/… #60
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
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions | |
name: "Checks" | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
permissions: | |
contents: read | |
concurrency: checks-${{ github.ref == 'refs/heads/main' && 'main' || github.event.pull_request.head.sha }} | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
id-token: write | |
issues: write | |
pull-requests: write | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
submodules: recursive | |
- uses: actions/[email protected] | |
with: | |
node-version-file: "package.json" | |
cache: "npm" | |
- id: node-modules | |
uses: actions/cache@v4 | |
with: | |
path: | | |
node_modules | |
packages/*/node_modules | |
key: node-modules-${{ hashFiles('package-lock.json') }} | |
- if: steps.node-modules.outputs.cache-hit != 'true' | |
run: npm ci --ignore-scripts | |
- run: npm install --ignore-scripts | |
- run: | | |
if [[ $(git status --porcelain) != "" ]]; then | |
git --no-pager diff --color --text HEAD | |
exit 1 | |
fi | |
- run: npm run build | |
- env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
run: npx semantic-release | |
lint: | |
name: Lint | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- uses: actions/[email protected] | |
with: | |
node-version-file: "package.json" | |
cache: "npm" | |
- id: node-modules | |
uses: actions/cache@v4 | |
with: | |
path: | | |
node_modules | |
packages/*/node_modules | |
key: node-modules-${{ hashFiles('package-lock.json') }} | |
- if: steps.node-modules.outputs.cache-hit != 'true' | |
run: npm ci --ignore-scripts | |
- run: npm install --ignore-scripts | |
- run: | | |
if [[ $(git status --porcelain) != "" ]]; then | |
git --no-pager diff --color --text HEAD | |
exit 1 | |
fi | |
- uses: actions/cache@v4 | |
with: | |
path: node_modules/.cache/prettier/.prettier-cache | |
key: prettier-${{ github.run_id }} | |
restore-keys: | | |
prettier- | |
- run: npm run lint | |
- run: | | |
if [[ $(git status --porcelain) != "" ]]; then | |
git --no-pager diff --color --text HEAD | |
exit 1 | |
fi | |
test: | |
name: Test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- uses: actions/[email protected] | |
with: | |
node-version-file: "package.json" | |
cache: "npm" | |
- id: node-modules | |
uses: actions/cache@v4 | |
with: | |
path: | | |
node_modules | |
packages/*/node_modules | |
key: node-modules-${{ hashFiles('package-lock.json') }} | |
- if: steps.node-modules.outputs.cache-hit != 'true' | |
run: npm ci --ignore-scripts | |
- run: npm install --ignore-scripts | |
- run: | | |
if [[ $(git status --porcelain) != "" ]]; then | |
git --no-pager diff --color --text HEAD | |
exit 1 | |
fi | |
- env: | |
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }} | |
run: npm run stryker |