Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci(workflow): add cache to workflows using actions/setup-node #407

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ jobs:
- uses: actions/setup-node@v2
with:
node-version: "12.x"
cache: npm
- run: npm ci
- run: npm run build
- run: npx semantic-release
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
uses: actions/setup-node@v2
with:
version: ${{ matrix.node_version }}
cache: npm
- run: npm ci
- run: npx jest --coverage

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/update-prettier.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ jobs:
- uses: actions/setup-node@v2
with:
version: 12
cache: npm
- run: npm ci
- run: "npm run lint:fix"
- uses: gr2m/[email protected]
Expand Down
17 changes: 12 additions & 5 deletions .github/workflows/update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ jobs:
# make sure that other actions get triggered when using `git push` in gr2m/create-or-update-pull-request-action
token: ${{ secrets.OCTOKITBOT_PAT }}
- uses: actions/setup-node@v2
with:
cache: npm

# try checking out routes-update branch. Ignore error if it does not exist
- run: git checkout routes-update || true
Expand All @@ -29,7 +31,8 @@ jobs:

# if update is coming from octokit/openapi, use the version from event
- run: npm run update-endpoints
if: github.event_name == 'repository_dispatch' && github.event.action == 'octokit/openapi release'
if: github.event_name == 'repository_dispatch' && github.event.action ==
'octokit/openapi release'
env:
VERSION: ${{ github.event.client_payload.release.tag_name }}

Expand All @@ -41,12 +44,16 @@ jobs:

# if event is coming from octokit/types.ts, update @octokit/types to latest version and get OpenAPI version from its package.json
- run: npm install @octokit/types@latest
if: github.event_name == 'repository_dispatch' && github.event.action == 'octokit/types.ts release'
- run: node -e "console.log('::set-output name=version::' + require('@octokit/types/package').octokit['openapi-version'])"
if: github.event_name == 'repository_dispatch' && github.event.action == 'octokit/types.ts release'
if: github.event_name == 'repository_dispatch' && github.event.action ==
'octokit/types.ts release'
- run: node -e "console.log('::set-output name=version::' +
require('@octokit/types/package').octokit['openapi-version'])"
if: github.event_name == 'repository_dispatch' && github.event.action ==
'octokit/types.ts release'
id: openapi_types
- run: npm run update-endpoints
if: github.event_name == 'repository_dispatch' && github.event.action == 'octokit/types.ts release'
if: github.event_name == 'repository_dispatch' && github.event.action ==
'octokit/types.ts release'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@oscard0m can you revert the style changes? Odd that this happened, don't you use prettier with default settings for formatting?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, I will revert them


I think I'm running prettier with no options so the default ones are applied but I will check what's happening.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found the issue, latest changes were not released in my octoherd script. I just run it in my fork and it worked: https://github.com/oscard0m/plugin-enterprise-server.js/pull/2

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

env:
VERSION: ${{ steps.openapi_types.outputs.version }}

Expand Down