Pull Request #29
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
name: pull_request | |
run-name: Pull Request | |
on: | |
pull_request: | |
types: [opened, synchronize, reopened, closed] | |
# Prevent running concurrently | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
env: | |
GH_TOKEN: ${{ github.token }} | |
jobs: | |
get_changed_files: | |
name: Get changed files | |
runs-on: ubuntu-latest | |
outputs: | |
changed_files: ${{ steps.changed_files.outputs.changed_files }} | |
python_files: ${{ steps.changed_files.outputs.python_files }} | |
changed_yaml_files: ${{ steps.changed_files.outputs.changed_yaml_files }} | |
changed_json_files: ${{ steps.changed_files.outputs.changed_json_files }} | |
test_value: ${{ steps.changed_files.outputs.test_value }} | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
ref: ${{ github.head_ref || github.ref }} | |
- name: Get changed files | |
id: changed_files | |
shell: bash | |
run: | | |
changed_files=`gh pr diff ${{ github.event.number }} --name-only | xargs` | |
echo "Changed files: $changed_files" | |
echo "changed_files=$changed_files" >> "$GITHUB_OUTPUT"&&echo"Set." | |
- name: Get changed python files | |
id: changed_python_files | |
shell: bash | |
run: | | |
cpf=`python3 ${{ github.workspace }}/deploy/_filter_files.py py ${{ steps.changed_files.outputs.changed_files }}` | |
echo "Changed python files: $cpf" | |
echo "python_files=$cpf" >> "$GITHUB_OUTPUT"&&echo"Set." | |
- name: Get changed yaml files | |
id: changed_yaml_files | |
shell: bash | |
run: | | |
cyf=`python3 ${{ github.workspace }}/deploy/_filter_files.py yml ${{ steps.changed_files.outputs.changed_files }}` | |
echo "Changed yaml files: $cyf" | |
echo "changed_yaml_files=$cyf" >> "$GITHUB_OUTPUT"&&echo"Set." | |
- name: Get changed json files | |
id: changed_json_files | |
shell: bash | |
run: | | |
cjf=`python3 ${{ github.workspace }}/deploy/_filter_files.py json ${{ steps.changed_files.outputs.changed_files }}` | |
echo "Changed json files: $cjf" | |
echo "changed_json_files=$cjf" >> "$GITHUB_OUTPUT"&&echo"Set." | |
- name: Get test value | |
id: test_value | |
shell: bash | |
run: | | |
echo "test_value=foo" >> "$GITHUB_OUTPUT"&&echo"Set." | |
echo_changed_files: | |
needs: get_changed_files | |
name: Echo changed files | |
runs-on: ubuntu-latest | |
steps: | |
- name: Echo changed files | |
env: | |
OUTPUTS: ${{ toJson(needs) }} | |
run: | | |
echo "All outputs: $OUTPUTS" | |
# format: | |
# name: Check format of python | |
# needs: get_changed_files | |
# uses: ./.github/workflows/format.yml | |
# with: | |
# files: ${{ needs.get_changed_files.outputs.changed_files }} | |
# lint: | |
# name: Lint python | |
# needs: get_changed_files | |
# uses: ./.github/workflows/lint.yml | |
# with: | |
# files: ${{ needs.get_changed_files.outputs.changed_files }} | |
# run_tests: | |
# name: Run tests | |
# uses: ./.github/workflows/tests.yml | |