diff --git a/.github/workflows/motoko-echo-example.yaml b/.github/workflows/motoko-echo-example.yaml index edf9795b7..c0736fd02 100644 --- a/.github/workflows/motoko-echo-example.yaml +++ b/.github/workflows/motoko-echo-example.yaml @@ -4,16 +4,33 @@ on: branches: - master pull_request: - paths: - - motoko/echo/** - - .github/workflows/provision-darwin.sh - - .github/workflows/provision-linux.sh - - .github/workflows/motoko-echo-example.yaml concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: + # JOB to run change detection + changes: + runs-on: ubuntu-latest + permissions: + pull-requests: read + # Set job outputs to values from filter step + outputs: + sources: ${{ steps.filter.outputs.sources }} + steps: + - uses: actions/checkout@v4 + if: github.event_name == 'push' + - uses: dorny/paths-filter@v3 + id: filter + with: + filters: | + sources: + - motoko/echo/** + - .github/workflows/provision-darwin.sh + - .github/workflows/provision-linux.sh + - .github/workflows/motoko-echo-example.yaml motoko-echo-example-darwin: + needs: changes + if: github.event_name == 'push' || needs.changes.outputs.sources == 'true' runs-on: macos-12 steps: - uses: actions/checkout@v1 @@ -26,6 +43,8 @@ jobs: make test popd motoko-echo-example-linux: + needs: changes + if: github.event_name == 'push' || needs.changes.outputs.sources == 'true' runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v1 diff --git a/.github/workflows/motoko-echo-skip.yaml b/.github/workflows/motoko-echo-skip.yaml deleted file mode 100644 index 096ba8307..000000000 --- a/.github/workflows/motoko-echo-skip.yaml +++ /dev/null @@ -1,20 +0,0 @@ -name: motoko-echo -on: - pull_request: - paths-ignore: - - motoko/echo/** - - .github/workflows/provision-darwin.sh - - .github/workflows/provision-linux.sh - - .github/workflows/motoko-echo-example.yaml -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true -jobs: - motoko-echo-example-darwin: - runs-on: ubuntu-latest - steps: - - run: echo 'Not needed - relevant folder not touched' - motoko-echo-example-linux: - runs-on: ubuntu-latest - steps: - - run: echo 'Not needed - relevant folder not touched' diff --git a/.github/workflows/motoko-factorial-example.yaml b/.github/workflows/motoko-factorial-example.yaml index b99dfd015..b9ed41d91 100644 --- a/.github/workflows/motoko-factorial-example.yaml +++ b/.github/workflows/motoko-factorial-example.yaml @@ -4,16 +4,33 @@ on: branches: - master pull_request: - paths: - - motoko/factorial/** - - .github/workflows/provision-darwin.sh - - .github/workflows/provision-linux.sh - - .github/workflows/motoko-factorial-example.yaml concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: + # JOB to run change detection + changes: + runs-on: ubuntu-latest + permissions: + pull-requests: read + # Set job outputs to values from filter step + outputs: + sources: ${{ steps.filter.outputs.sources }} + steps: + - uses: actions/checkout@v4 + if: github.event_name == 'push' + - uses: dorny/paths-filter@v3 + id: filter + with: + filters: | + sources: + - motoko/factorial/** + - .github/workflows/provision-darwin.sh + - .github/workflows/provision-linux.sh + - .github/workflows/motoko-factorial-example.yaml motoko-factorial-example-darwin: + needs: changes + if: github.event_name == 'push' || needs.changes.outputs.sources == 'true' runs-on: macos-12 steps: - uses: actions/checkout@v1 @@ -26,6 +43,8 @@ jobs: make test popd motoko-factorial-example-linux: + needs: changes + if: github.event_name == 'push' || needs.changes.outputs.sources == 'true' runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v1 diff --git a/.github/workflows/motoko-factorial-skip.yaml b/.github/workflows/motoko-factorial-skip.yaml deleted file mode 100644 index f3fa6e4d0..000000000 --- a/.github/workflows/motoko-factorial-skip.yaml +++ /dev/null @@ -1,20 +0,0 @@ -name: motoko-factorial -on: - pull_request: - paths-ignore: - - motoko/factorial/** - - .github/workflows/provision-darwin.sh - - .github/workflows/provision-linux.sh - - .github/workflows/motoko-factorial-example.yaml -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true -jobs: - motoko-factorial-example-darwin: - runs-on: ubuntu-latest - steps: - - run: echo 'Not needed - relevant folder not touched' - motoko-factorial-example-linux: - runs-on: ubuntu-latest - steps: - - run: echo 'Not needed - relevant folder not touched' \ No newline at end of file diff --git a/.github/workflows/motoko-hello-world-example.yaml b/.github/workflows/motoko-hello-world-example.yaml index ebd1e4565..de6f809c6 100644 --- a/.github/workflows/motoko-hello-world-example.yaml +++ b/.github/workflows/motoko-hello-world-example.yaml @@ -4,16 +4,33 @@ on: branches: - master pull_request: - paths: - - motoko/hello-world/** - - .github/workflows/provision-darwin.sh - - .github/workflows/provision-linux.sh - - .github/workflows/motoko-hello-world-example.yaml concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: + # JOB to run change detection + changes: + runs-on: ubuntu-latest + permissions: + pull-requests: read + # Set job outputs to values from filter step + outputs: + sources: ${{ steps.filter.outputs.sources }} + steps: + - uses: actions/checkout@v4 + if: github.event_name == 'push' + - uses: dorny/paths-filter@v3 + id: filter + with: + filters: | + sources: + - motoko/hello-world/** + - .github/workflows/provision-darwin.sh + - .github/workflows/provision-linux.sh + - .github/workflows/motoko-hello-world-example.yaml motoko-hello-world-example-darwin: + needs: changes + if: github.event_name == 'push' || needs.changes.outputs.sources == 'true' runs-on: macos-12 steps: - uses: actions/checkout@v1 @@ -26,6 +43,8 @@ jobs: make test popd motoko-hello-world-example-linux: + needs: changes + if: github.event_name == 'push' || needs.changes.outputs.sources == 'true' runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v1 diff --git a/.github/workflows/motoko-hello-world-skip.yaml b/.github/workflows/motoko-hello-world-skip.yaml deleted file mode 100644 index 9f7f7121c..000000000 --- a/.github/workflows/motoko-hello-world-skip.yaml +++ /dev/null @@ -1,20 +0,0 @@ -name: motoko-hello-world -on: - pull_request: - paths-ignore: - - motoko/hello-world/** - - .github/workflows/provision-darwin.sh - - .github/workflows/provision-linux.sh - - .github/workflows/motoko-hello-world-example.yaml -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true -jobs: - motoko-hello-world-example-darwin: - runs-on: ubuntu-latest - steps: - - run: echo 'Not needed - relevant folder not touched' - motoko-hello-world-example-linux: - runs-on: ubuntu-latest - steps: - - run: echo 'Not needed - relevant folder not touched' diff --git a/.github/workflows/motoko-phone-book-example.yaml b/.github/workflows/motoko-phone-book-example.yaml index 39ed27fd9..8cb7fa5d5 100644 --- a/.github/workflows/motoko-phone-book-example.yaml +++ b/.github/workflows/motoko-phone-book-example.yaml @@ -4,16 +4,33 @@ on: branches: - master pull_request: - paths: - - motoko/phone-book/** - - .github/workflows/provision-darwin.sh - - .github/workflows/provision-linux.sh - - .github/workflows/motoko-phone-book-example.yaml concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: + # JOB to run change detection + changes: + runs-on: ubuntu-latest + permissions: + pull-requests: read + # Set job outputs to values from filter step + outputs: + sources: ${{ steps.filter.outputs.sources }} + steps: + - uses: actions/checkout@v4 + if: github.event_name == 'push' + - uses: dorny/paths-filter@v3 + id: filter + with: + filters: | + sources: + - motoko/phone-book/** + - .github/workflows/provision-darwin.sh + - .github/workflows/provision-linux.sh + - .github/workflows/motoko-phone-book-example.yaml motoko-phone-book-example-darwin: + needs: changes + if: github.event_name == 'push' || needs.changes.outputs.sources == 'true' runs-on: macos-12 steps: - uses: actions/checkout@v1 @@ -26,6 +43,8 @@ jobs: make test popd motoko-phone-book-example-linux: + needs: changes + if: github.event_name == 'push' || needs.changes.outputs.sources == 'true' runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v1 diff --git a/.github/workflows/motoko-phone-book-skip.yaml b/.github/workflows/motoko-phone-book-skip.yaml deleted file mode 100644 index 3862ffaa5..000000000 --- a/.github/workflows/motoko-phone-book-skip.yaml +++ /dev/null @@ -1,20 +0,0 @@ -name: motoko-phone-book -on: - pull_request: - paths-ignore: - - motoko/phone-book/** - - .github/workflows/provision-darwin.sh - - .github/workflows/provision-linux.sh - - .github/workflows/motoko-phone-book-example.yaml -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true -jobs: - motoko-phone-book-example-darwin: - runs-on: ubuntu-latest - steps: - - run: echo 'Not needed - relevant folder not touched' - motoko-phone-book-example-linux: - runs-on: ubuntu-latest - steps: - - run: echo 'Not needed - relevant folder not touched' diff --git a/.github/workflows/motoko-pub-sub-example.yaml b/.github/workflows/motoko-pub-sub-example.yaml index 66b2440b2..9eaef717c 100644 --- a/.github/workflows/motoko-pub-sub-example.yaml +++ b/.github/workflows/motoko-pub-sub-example.yaml @@ -4,16 +4,33 @@ on: branches: - master pull_request: - paths: - - motoko/pub-sub/** - - .github/workflows/provision-darwin.sh - - .github/workflows/provision-linux.sh - - .github/workflows/motoko-pub-sub-example.yaml concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: + # JOB to run change detection + changes: + runs-on: ubuntu-latest + permissions: + pull-requests: read + # Set job outputs to values from filter step + outputs: + sources: ${{ steps.filter.outputs.sources }} + steps: + - uses: actions/checkout@v4 + if: github.event_name == 'push' + - uses: dorny/paths-filter@v3 + id: filter + with: + filters: | + sources: + - motoko/pub-sub/** + - .github/workflows/provision-darwin.sh + - .github/workflows/provision-linux.sh + - .github/workflows/motoko-pub-sub-example.yaml motoko-pub-sub-example-darwin: + needs: changes + if: github.event_name == 'push' || needs.changes.outputs.sources == 'true' runs-on: macos-12 steps: - uses: actions/checkout@v1 @@ -26,6 +43,8 @@ jobs: make test popd motoko-pub-sub-example-linux: + needs: changes + if: github.event_name == 'push' || needs.changes.outputs.sources == 'true' runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v1 diff --git a/.github/workflows/motoko-pub-sub-skip.yaml b/.github/workflows/motoko-pub-sub-skip.yaml deleted file mode 100644 index 5061571d7..000000000 --- a/.github/workflows/motoko-pub-sub-skip.yaml +++ /dev/null @@ -1,20 +0,0 @@ -name: motoko-pub-sub -on: - pull_request: - paths-ignore: - - motoko/pub-sub/** - - .github/workflows/provision-darwin.sh - - .github/workflows/provision-linux.sh - - .github/workflows/motoko-pub-sub-example.yaml -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true -jobs: - motoko-pub-sub-example-darwin: - runs-on: ubuntu-latest - steps: - - run: echo 'Not needed - relevant folder not touched' - motoko-pub-sub-example-linux: - runs-on: ubuntu-latest - steps: - - run: echo 'Not needed - relevant folder not touched' diff --git a/.github/workflows/motoko-quicksort-example.yaml b/.github/workflows/motoko-quicksort-example.yaml index 7d1fba054..8a950af0f 100644 --- a/.github/workflows/motoko-quicksort-example.yaml +++ b/.github/workflows/motoko-quicksort-example.yaml @@ -4,16 +4,33 @@ on: branches: - master pull_request: - paths: - - motoko/quicksort/** - - .github/workflows/provision-darwin.sh - - .github/workflows/provision-linux.sh - - .github/workflows/motoko-quicksort-example.yaml concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: + # JOB to run change detection + changes: + runs-on: ubuntu-latest + permissions: + pull-requests: read + # Set job outputs to values from filter step + outputs: + sources: ${{ steps.filter.outputs.sources }} + steps: + - uses: actions/checkout@v4 + if: github.event_name == 'push' + - uses: dorny/paths-filter@v3 + id: filter + with: + filters: | + sources: + - motoko/quicksort/** + - .github/workflows/provision-darwin.sh + - .github/workflows/provision-linux.sh + - .github/workflows/motoko-quicksort-example.yaml motoko-quicksort-example-darwin: + needs: changes + if: github.event_name == 'push' || needs.changes.outputs.sources == 'true' runs-on: macos-12 steps: - uses: actions/checkout@v1 @@ -26,6 +43,8 @@ jobs: make test popd motoko-quicksort-example-linux: + needs: changes + if: github.event_name == 'push' || needs.changes.outputs.sources == 'true' runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v1 diff --git a/.github/workflows/motoko-quicksort-skip.yaml b/.github/workflows/motoko-quicksort-skip.yaml deleted file mode 100644 index 54352b6cd..000000000 --- a/.github/workflows/motoko-quicksort-skip.yaml +++ /dev/null @@ -1,20 +0,0 @@ -name: motoko-quicksort -on: - pull_request: - paths-ignore: - - motoko/quicksort/** - - .github/workflows/provision-darwin.sh - - .github/workflows/provision-linux.sh - - .github/workflows/motoko-quicksort-example.yaml -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true -jobs: - motoko-quicksort-example-darwin: - runs-on: ubuntu-latest - steps: - - run: echo 'Not needed - relevant folder not touched' - motoko-quicksort-example-linux: - runs-on: ubuntu-latest - steps: - - run: echo 'Not needed - relevant folder not touched' diff --git a/.github/workflows/motoko-simple-to-do-example.yaml b/.github/workflows/motoko-simple-to-do-example.yaml index 0c376c761..00a3d587b 100644 --- a/.github/workflows/motoko-simple-to-do-example.yaml +++ b/.github/workflows/motoko-simple-to-do-example.yaml @@ -4,16 +4,33 @@ on: branches: - master pull_request: - paths: - - motoko/simple-to-do/** - - .github/workflows/provision-darwin.sh - - .github/workflows/provision-linux.sh - - .github/workflows/motoko-simple-to-do-example.yaml concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: + # JOB to run change detection + changes: + runs-on: ubuntu-latest + permissions: + pull-requests: read + # Set job outputs to values from filter step + outputs: + sources: ${{ steps.filter.outputs.sources }} + steps: + - uses: actions/checkout@v4 + if: github.event_name == 'push' + - uses: dorny/paths-filter@v3 + id: filter + with: + filters: | + sources: + - motoko/simple-to-do/** + - .github/workflows/provision-darwin.sh + - .github/workflows/provision-linux.sh + - .github/workflows/motoko-simple-to-do-example.yaml motoko-simple-to-do-example-darwin: + needs: changes + if: github.event_name == 'push' || needs.changes.outputs.sources == 'true' runs-on: macos-12 steps: - uses: actions/checkout@v1 @@ -26,6 +43,8 @@ jobs: make test popd motoko-simple-to-do-example-linux: + needs: changes + if: github.event_name == 'push' || needs.changes.outputs.sources == 'true' runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v1 diff --git a/.github/workflows/motoko-simple-to-do-skip.yaml b/.github/workflows/motoko-simple-to-do-skip.yaml deleted file mode 100644 index 22be1a42b..000000000 --- a/.github/workflows/motoko-simple-to-do-skip.yaml +++ /dev/null @@ -1,20 +0,0 @@ -name: motoko-simple-to-do -on: - pull_request: - paths-ignore: - - motoko/simple-to-do/** - - .github/workflows/provision-darwin.sh - - .github/workflows/provision-linux.sh - - .github/workflows/motoko-simple-to-do-example.yaml -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true -jobs: - motoko-simple-to-do-example-darwin: - runs-on: ubuntu-latest - steps: - - run: echo 'Not needed - relevant folder not touched' - motoko-simple-to-do-example-linux: - runs-on: ubuntu-latest - steps: - - run: echo 'Not needed - relevant folder not touched' diff --git a/.github/workflows/motoko-superheroes-example.yaml b/.github/workflows/motoko-superheroes-example.yaml index 33d49b91c..88a732401 100644 --- a/.github/workflows/motoko-superheroes-example.yaml +++ b/.github/workflows/motoko-superheroes-example.yaml @@ -4,16 +4,33 @@ on: branches: - master pull_request: - paths: - - motoko/superheroes/** - - .github/workflows/provision-darwin.sh - - .github/workflows/provision-linux.sh - - .github/workflows/motoko-superheroes-example.yaml concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: + # JOB to run change detection + changes: + runs-on: ubuntu-latest + permissions: + pull-requests: read + # Set job outputs to values from filter step + outputs: + sources: ${{ steps.filter.outputs.sources }} + steps: + - uses: actions/checkout@v4 + if: github.event_name == 'push' + - uses: dorny/paths-filter@v3 + id: filter + with: + filters: | + sources: + - motoko/superheroes/** + - .github/workflows/provision-darwin.sh + - .github/workflows/provision-linux.sh + - .github/workflows/motoko-superheroes-example.yaml motoko-superheroes-example-darwin: + needs: changes + if: github.event_name == 'push' || needs.changes.outputs.sources == 'true' runs-on: macos-12 steps: - uses: actions/checkout@v1 @@ -26,6 +43,8 @@ jobs: make test popd motoko-superheroes-example-linux: + needs: changes + if: github.event_name == 'push' || needs.changes.outputs.sources == 'true' runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v1 diff --git a/.github/workflows/motoko-superheroes-skip.yaml b/.github/workflows/motoko-superheroes-skip.yaml deleted file mode 100644 index 75f75c24c..000000000 --- a/.github/workflows/motoko-superheroes-skip.yaml +++ /dev/null @@ -1,20 +0,0 @@ -name: motoko-superheroes -on: - pull_request: - paths-ignore: - - motoko/superheroes/** - - .github/workflows/provision-darwin.sh - - .github/workflows/provision-linux.sh - - .github/workflows/motoko-superheroes-example.yaml -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true -jobs: - motoko-superheroes-example-darwin: - runs-on: ubuntu-latest - steps: - - run: echo 'Not needed - relevant folder not touched' - motoko-superheroes-example-linux: - runs-on: ubuntu-latest - steps: - - run: echo 'Not needed - relevant folder not touched'