name: joystream-node-checks
on:
  pull_request:

jobs:
  checks:
    name: joystream-node checks
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v1
      - uses: actions/setup-node@v1
        with:
          node-version: '14.x'
      - uses: technote-space/get-diff-action@v3
        with:
          PREFIX_FILTER: |
            node
            runtime-modules
            utils/chain-spec-builder
          SUFFIX_FILTER: |
            .rs
          FILES: |
            Cargo.lock
            Cargo.toml

      # TODO: Look for change in source code but no corresponding version bump of runtime or binaries
      # - name: Check version modified correctly
      #   if: env.GIT_DIFF

      # This Building natively is not really necessary because we have the docker build which
      # hapens in the run-network-tests workflow which is sufficient!
      # - name: Build if runtime was modified
      #   run: |
      #     ./setup.sh
      #     yarn cargo-checks
      #     yarn cargo-build
      #   if: env.GIT_DIFF