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 all 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
21 changes: 19 additions & 2 deletions .github/workflow-templates/_setup.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,26 @@

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 picked up by
# anything that uses actions-utils (e.g. eslint-action, jest-action, etc.)
- uses: allenevans/set-env@v2.0.0
with:
ALL_CHANGED_FILES: '${{ steps.changed.outputs.added_modified }}'
10 changes: 5 additions & 5 deletions .github/workflow-templates/pr-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,23 @@ jobs:
steps:
- name: Run eslint
uses: Khan/eslint-action@main
setup: yarn
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
17 changes: 15 additions & 2 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