Skip to content

Commit

Permalink
ci: back to old changed files
Browse files Browse the repository at this point in the history
  • Loading branch information
sheverniskiy committed Jun 2, 2022
1 parent e61ee5a commit 52c78db
Showing 1 changed file with 13 additions and 36 deletions.
49 changes: 13 additions & 36 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 52c78db

Please sign in to comment.