-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from dora56/github-actions
chore: Add GitHub Actions
- Loading branch information
Showing
7 changed files
with
10,100 additions
and
4,399 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: Common Build | ||
description: Common Operation(build) | ||
runs: | ||
using: 'composite' | ||
steps: | ||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: '20.10.x' | ||
|
||
- name: Install dependencies | ||
run: npm install | ||
shell: bash | ||
|
||
- name: build | ||
run: npm run build | ||
shell: bash |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: npm | ||
directory: '/' | ||
schedule: | ||
interval: weekly | ||
timezone: 'Asia/Tokyo' |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: Release | ||
|
||
on: | ||
workflow_run: | ||
workflows: | ||
- Test | ||
branches: | ||
- main | ||
types: | ||
- completed | ||
|
||
permissions: | ||
contents: write | ||
issues: write | ||
jobs: | ||
release: | ||
name: Release | ||
runs-on: ubuntu-latest | ||
if: ${{ github.event.workflow_run.conclusion == 'success' }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: Build | ||
uses: ./.github/actions/build | ||
- name: Release | ||
env: | ||
NPM_TOKEN: ${{secrets.NPM_TOKEN}} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: npx semantic-release |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: Test | ||
|
||
on: [push] | ||
|
||
jobs: | ||
canCreateRuleFile: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Build | ||
uses: ./.github/actions/build | ||
- run: npm run createrule | ||
|
||
test: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Build | ||
uses: ./.github/actions/build | ||
- name: Jest testing | ||
run: npm run test:jest | ||
- name: TextLint testing | ||
run: npm run test:lint | ||
- name: Upload coverage reports to Codecov | ||
uses: codecov/codecov-action@v3 | ||
env: | ||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | ||
with: | ||
fail_ci_if_error: true | ||
directory: ./coverage |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: Auto-create regular rules | ||
permissions: | ||
contents: write | ||
pull-requests: write | ||
|
||
on: | ||
schedule: | ||
- cron: '0 0 1 * *' | ||
- cron: '0 0 15 * *' | ||
workflow_dispatch: | ||
|
||
env: | ||
HAS_CHANGES: '' | ||
|
||
jobs: | ||
auto-create-rules: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Build | ||
uses: ./.github/actions/build | ||
|
||
- name: Run createRule.js | ||
run: npm run createrule | ||
|
||
- name: Check for changes in auto-create-regular-rules.yml | ||
id: check-diff | ||
run: echo "HAS_CHANGES=$(git diff --name-only)" >> $GITHUB_ENV | ||
|
||
- name: Create Pull Request | ||
uses: peter-evans/create-pull-request@v3 | ||
if: ${{ env.HAS_CHANGES }} == 'dict/auto-create-regular-rules.yml' | ||
with: | ||
title: 'Update auto-create-regular-rules.yml' | ||
commit-message: 'feat: update auto-create-regular-rules.yml' | ||
branch: auto-update-regular-rules | ||
base: main | ||
delete-branch: true | ||
token: ${{ secrets.GITHUB_TOKEN }} |
Oops, something went wrong.