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

Update to use new actions-utils that is aware of ALL_CHANGED_FILES #28

Merged
merged 28 commits into from
Aug 4, 2021
Merged
Show file tree
Hide file tree
Changes from 27 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
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
20 changes: 18 additions & 2 deletions .github/workflow-templates/_setup.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,25 @@

setup:
checkout:
- uses: actions/checkout@v1
name: get the repo
- uses: actions/checkout@v2
yarn:
setup: checkout
steps:
- run: yarn

# This gets the list of files that changed in the current pull-request
# and puts then onto the ALL_CHANGED_FILES env variable, which several
# of our actions will use.
changed-files:
steps:
- name: Get All Changed Files
uses: jaredly/get-changed-files@v1.0.1
id: changed
with:
format: 'json' # robust to filenames with spaces
absolute: true # our tooling expects absolute paths

# Now we put it on the environment so that it can be
Copy link
Member

Choose a reason for hiding this comment

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

...can be??

- uses: allenevans/set-env@v2.0.0
with:
ALL_CHANGED_FILES: '${{ steps.changed.outputs.added_modified }}'
12 changes: 6 additions & 6 deletions .github/workflow-templates/pr-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,24 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Run eslint
uses: Khan/eslint-action@main
setup: yarn
uses: Khan/eslint-action@da16c43dd352e1e606c838008e7f25e3bf3fbf97
Copy link
Member

Choose a reason for hiding this comment

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

Would we revert this to main once this lands? or...?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah I can change it before landing

setup: [yarn, changed-files]
with:
eslint-lib: ./node_modules/eslint
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Run jest tests
uses: Khan/jest-action@main
setup: yarn
setup: [yarn, changed-files]
with:
jest-bin: ./node_modules/.bin/jest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Run jest coverage
uses: Khan/jest-coverage-action@main
setup: yarn
setup: [yarn, changed-files]
with:
jest-bin: ./node_modules/.bin/jest
coverage-data-path: ./coverage/coverage-final.json
Expand All @@ -36,15 +36,15 @@ jobs:

- name: Run flow
uses: Khan/flow-action@main
setup: yarn
setup: [yarn, changed-files]
with:
flow-bin: ./node_modules/.bin/flow
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Run flow coverage
uses: Khan/flow-coverage-action@main
setup: yarn
setup: [yarn, changed-files]
with:
flow-bin: ./node_modules/.bin/flow
env:
Expand Down
19 changes: 16 additions & 3 deletions .github/workflows/pr-actions.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions .github/workflows/pr-autofix.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading