Skip to content

Commit

Permalink
ci: Update node versions retrieval algorithm
Browse files Browse the repository at this point in the history
  • Loading branch information
mykola-mokhnach authored Oct 26, 2022
1 parent de39fc6 commit 344b5fe
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,13 @@ jobs:
- name: Generate Node.js versions matrix
id: generate-matrix
run: |
current_lts=$(curl -s https://nodejs.org/en/ | grep -E -o 'Download [0-9.]+ LTS' | grep -E -o '([0-9]+)' | head -n 1)
previous_lts=$(( current_lts - 2 ))
next_lts=$(( current_lts + 2 ))
VERSIONS="[$previous_lts, $current_lts, $next_lts]"
sudo apt-get install -y lynx
lynx -dump https://endoflife.date/nodejs | grep -E -o '[0-9]+ \(LTS\)' | grep -E -o '([0-9]+)' > eol.list
cat eol.list
lts1=$(cat eol.list | head -1)
lts2=$(cat eol.list | head -2 | tail -1)
lts3=$(cat eol.list | head -3 | tail -1)
VERSIONS="[$lts1, $lts2, $lts3]"
echo ::set-output name=versions::${VERSIONS}
test:
Expand Down

0 comments on commit 344b5fe

Please sign in to comment.