Skip to content

Commit

Permalink
workflow(ci): update ci to remove Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
trilom committed Mar 19, 2020
1 parent 60116bd commit cc81c9b
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 46 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ jobs:
matrix:
event_type: ['push', 'pull_request']
build: ['true', 'false']
output: ['json', ',', ' ', '_<br />&nbsp;&nbsp;_']
fileOutput: ['json', ',', ' ', '_<br />&nbsp;&nbsp;_']
output: ['json', ',', ''' ''', '_<br />&nbsp;&nbsp;_']
fileOutput: ['json', ',', ''' ''', '_<br />&nbsp;&nbsp;_']
# event_type: ['pull_request']
# build: ['true']
# output: ['json']
Expand All @@ -34,7 +34,7 @@ jobs:
echo '${{toJSON(steps)}}'
- uses: actions/checkout@v2
if: matrix.build
- run: make run
- run: yarn build
if: matrix.build
- uses: ./
id: file_changes_build_pr
Expand Down
18 changes: 11 additions & 7 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ jobs:
- uses: actions/checkout@v2
- run: yarn build
- run: yarn test-coverage
- run: bash <(curl -s https://codecov.io/bash)
if: contains(env.isFork, 'false')
- uses: actions/github-script@0.6.0
if: failure() && contains(env.isFork, 'false')
with:
Expand All @@ -69,12 +71,13 @@ jobs:
if: github.event.pull_request.head.repo.full_name != github.repository
steps:
- uses: actions/checkout@v2
- run: yarn build
- name: Lint and report
uses: reviewdog/action-eslint@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
reporter: github-check
eslint_flags: 'src/**/*.ts'
eslint_flags: '--ext .ts ./'
# lint code and comment back if possible
lintdog:
name: eslintdog (reviewdog)
Expand All @@ -83,12 +86,13 @@ jobs:
if: github.event.pull_request.head.repo.full_name == github.repository
steps:
- uses: actions/checkout@v2
- run: yarn build
- name: Lint and report
uses: reviewdog/action-eslint@v1
with:
github_token: ${{ secrets.TRILOM_BOT_TOKEN }}
reporter: github-pr-review
eslint_flags: 'src/**/*.ts'
eslint_flags: '--ext .ts ./'
- uses: actions/github-script@0.6.0
if: failure()
with:
Expand Down Expand Up @@ -125,15 +129,15 @@ jobs:
token: ${{ secrets.TRILOM_BOT_TOKEN }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
- run: make run
- run: make run COMMAND=format-check
- name: make run COMMAND=format and push code if check failed
- run: yarn build
- run: yarn format-check
- name: yarn format and push code if check failed
if: failure() && github.actor != 'trilom-bot' && contains(env.isFork, 'false')
env:
GITHUB_TOKEN: ${{ secrets.TRILOM_BOT_TOKEN }}
run: |
make run COMMAND=format
sudo make clean
yarn format
sudo yarn clean
git config --local user.email "trilom-bot@trailmix.me"
git config --local user.name "trilom-bot"
git add -A
Expand Down
21 changes: 13 additions & 8 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,18 @@ jobs:
run: |
git config --local user.email "trilom-bot@trailmix.me"
git config --local user.name "trilom-bot"
make run
make run COMMAND=release-pack
git add -A
git diff-index --quiet HEAD || git commit -m "Adding release changes ⚙️" -a
make run COMMAND=format
yarn build
yarn format
git add -A
git diff-index --quiet HEAD || git commit -m "Adding format changes 🤖" -a
yarn build-release
git add -A
git diff-index --quiet HEAD || git commit -m "Adding release changes ⚙️" -a
git log --format='%aN <%aE>%n%cN <%cE>' | sort -u > AUTHORS
sed -i '/trilom-bot/d' AUTHORS
sed -i '/semantic-release-bot/d' AUTHORS
sed -i '/carnoco@gmail.com/d' AUTHORS
sed -i '/GitHub <noreply@github.com>/d' AUTHORS
echo -e "\r\n$(date)" >> AUTHORS
git add -A
git diff-index --quiet HEAD || git commit -m "Updating AUTHORS 📓" -a
Expand Down Expand Up @@ -263,15 +267,16 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: make run
- run: yarn build
# test with jest
test:
name: jest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: make run
- run: make run COMMAND=test
- run: yarn build
- run: yarn test-coverage
- run: bash <(curl -s https://codecov.io/bash)
# lint code and comment back if possible
lintdog:
name: eslintdog (reviewdog)
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,29 +43,29 @@

- When any `opened`, `reopened`, or `synchronize` **Pull Request** type runs(**pr.yml**):
- Assign it to trilom (**add-reviews**)
- Build code with `make run` which runs `yarn` and `tsc` (**build**)
- Build code with `yarn build` which runs `yarn` and `tsc` (**build**)
- Label with builds if passing and on inner workspace
- Test code with `make run COMMAND=test` which runs `jest` (**test**)
- Test code with `yarn test-coverage` which runs `jest` (**test**)
- Label with tested if passing and on inner workspace
- Test code with eslint reviewdog and report back if inner workspace (**lintdog**)
- Label with pretty if passing and on inner workspace
- Check format of code with `make run COMMAND=format-check` which runs `prettier --check` (**format_check_push**)
- Check format of code with `yarn format-check` which runs `prettier --check` (**format_check_push**)
- If:
- Fork then pull **Pull Request** github.ref with GITHUB_TOKEN
- Inner **Pull Request** then pull HEAD repo ref
- Build code with `make run` which runs `yarn` and `tsc`
- Build code with `yarn build` which runs `yarn` and `tsc`
- If format-check succeeds and on inner workspace
- Label with pretty
- If format-check fails and on inner workspace and actor is not trilom-bot
- Run `make run COMMAND=format` which runs `prettier --write`
- Clean build files with `make clean`
- Run `yarn format` which runs `prettier --write`
- Clean build files with `yarn clean`
- Commit the format changes as trilom-bot to **Pull Request** head

## Push

- When any **Push** type runs to _master_, _next_, _alpha_, or _beta_(**push.yml**):
- Build code with `make run` which runs `yarn` and `tsc` (**build**)
- Test code with `make run COMMAND=test` which runs `jest` (**test**)
- Build code with `yarn build` which runs `yarn` and `tsc` (**build**)
- Test code with `yarn test-coverage` which runs `jest` (**test**)
- Test code with eslint reviewdog and report back with github checks(**lintdog**)
- When any **Push** type runs to _master_, _next_, _alpha_, or _beta_ with a head_commit message **NOT** containing 'trilom/v1.' or 'trilom/v2.':
- Build **dist/\*\*.js** files, update **AUTHORS**, format **src/\*\*.ts** files and commit.
Expand Down
20 changes: 0 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,24 +195,4 @@ jobs:
- name: test
run: |
cat $HOME/files.txt
```

```bash
# install project dependencies (including devDependencies)
yarn
# build the project (dist files)
yarn build
# build and lint
# run prettier (this will make your ugly code pretty)
yarn format
# dry-run prettier (this will tell you if your ugly code needs to be made pretty)
yarn format-check
# lint project
yarn lint
# test
yarn jest
# clean duh
yarn clean
```

0 comments on commit cc81c9b

Please sign in to comment.