Skip to content

Commit

Permalink
ci: changed files gate rework
Browse files Browse the repository at this point in the history
  • Loading branch information
sheverniskiy committed Jun 2, 2022
1 parent 99e0c77 commit e61ee5a
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 13 deletions.
47 changes: 36 additions & 11 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,33 +21,58 @@ jobs:
- name: Checkout repo
uses: actions/checkout@v2

- name: Get changed files
- name: Changed files
id: changed-files
uses: tj-actions/changed-files@v21
with:
files: |
**/*.ts
**/*.js
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 }}"
- name: Use Node ${{ matrix.node }}
if: steps.changed-files.outputs.only_changed == 'true'
if: steps.changed-files.outputs.result == '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.only_changed == 'true'
if: steps.changed-files.outputs.result == 'true'
run: yarn

- name: Lint
if: steps.changed-files.outputs.only_changed == 'true'
if: steps.changed-files.outputs.result == 'true'
run: yarn lint

- name: Test
if: steps.changed-files.outputs.only_changed == 'true'
if: steps.changed-files.outputs.result == 'true'
run: yarn test --ci --maxWorkers=2

- name: Build
if: steps.changed-files.outputs.only_changed == 'true'
if: steps.changed-files.outputs.result == 'true'
run: yarn build
4 changes: 2 additions & 2 deletions src/gismeteo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,8 @@ export class Gismeteo {
}

/**
* It takes a city name, gets the city URI, then makes a request to the Gismeteo site, parses the
* HTML, and returns an array of GismeteoTenDays
* It takes a city name, then makes a request to the Gismeteo, parses the
* HTML, and returns an array of GismeteoTenDays with the weather data
* @param {string} city - string - the name of the city you want to get the weather for
* @returns An array of GismeteoTenDays.
*/
Expand Down

0 comments on commit e61ee5a

Please sign in to comment.