From 52c78db431bf8671841d9652f5bc7b2ba8bfaa33 Mon Sep 17 00:00:00 2001 From: sheverniskiy Date: Thu, 2 Jun 2022 12:02:11 +0300 Subject: [PATCH] ci: back to old changed files --- .github/workflows/push.yml | 49 ++++++++++---------------------------- 1 file changed, 13 insertions(+), 36 deletions(-) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 80fe888..2986826 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -20,59 +20,36 @@ jobs: steps: - name: Checkout repo uses: actions/checkout@v2 + with: + fetch-depth: 0 - - name: Changed files + - name: Get changed files id: changed-files - run: | - pattern=(".js" ".ts") - result=false - prev_sha=$(git rev-parse --quiet --verify ${{ github.sha }}^) - echo "============================================================== - โ™ฟ๏ธ fsharp owned you - ๐Ÿšง Branch: ${{ github.ref_name }} - โคด๏ธ Current sha: ${{ github.sha }} - โฌ‡๏ธ Previous sha: $prev_sha - ============================================================== - ๐Ÿ“œ List of diff files:" - for file in $(git diff --name-only $prev_sha ${{ github.sha }}); do - echo "๐Ÿ”ธ $file" - for element in "${pattern[@]}" - do - if [[ $file == *$element* ]]; then - result=true - echo "๐Ÿšจ $file > $element" - fi - done - done - echo "result=$result" >> $GITHUB_ENV - echo "::set-output name=result::$result" - echo "==============================================================" - echo "๐Ÿ Result: $result" - - - name: Use my results - run: | - echo "Check ${{ env.result }}" - echo "Check2 ${{ steps.files.outputs.result }}" + uses: tj-actions/changed-files@v21 + with: + files: | + **/*.ts + **/*.js - name: Use Node ${{ matrix.node }} - if: steps.changed-files.outputs.result == 'true' + if: steps.changed-files.outputs.only_changed == 'true' uses: actions/setup-node@v3 with: node-version: ${{ matrix.node }} cache: 'yarn' - name: Install deps and build (with cache) - if: steps.changed-files.outputs.result == 'true' + if: steps.changed-files.outputs.only_changed == 'true' run: yarn - name: Lint - if: steps.changed-files.outputs.result == 'true' + if: steps.changed-files.outputs.only_changed == 'true' run: yarn lint - name: Test - if: steps.changed-files.outputs.result == 'true' + if: steps.changed-files.outputs.only_changed == 'true' run: yarn test --ci --maxWorkers=2 - name: Build - if: steps.changed-files.outputs.result == 'true' + if: steps.changed-files.outputs.only_changed == 'true' run: yarn build