@@ -5,6 +5,7 @@ on: # yamllint disable-line rule:truthy
55 pull_request :
66 paths :
77 - .github/workflows/functional-tests.yml
8+ - src/**
89 - action.yml
910 push :
1011 branches :
@@ -26,17 +27,21 @@ jobs:
2627 outputs :
2728 versions : ${{ steps.prepare-list.outputs.versions }}
2829 steps :
30+ - name : Get releases
31+ id : github-releases
32+ uses : yakubique/github-releases@v1.2
33+ env :
34+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
35+ with :
36+ repository : " ciao-lang/ciao"
37+ sort : " desc"
2938 - name : Prepare list
3039 id : prepare-list
3140 env :
3241 RELEASES_AMOUNT : " 3"
33- TARGET_REPO : " ciao-lang/ciao"
3442 run : |
35- versions=$(curl -sL \
36- -H "Accept: application/vnd.github+json" \
37- -H "X-GitHub-Api-Version: 2022-11-28" \
38- "https://api.github.com/repos/${TARGET_REPO}/releases" \
39- | jq -c -r --arg n "${RELEASES_AMOUNT}" '[.[0:($n | tonumber)][].tag_name] | map(sub("^v"; "")) | . += ["latest"]')
43+ versions=$(echo '${{ steps.github-releases.outputs.releases }}' \
44+ | jq -c -r --arg n "${RELEASES_AMOUNT}" '.[0:($n | tonumber)] | map(sub("^v"; "")) | . += ["latest"]')
4045 echo "versions=${versions}" >> "$GITHUB_OUTPUT"
4146 setup-ciao :
4247 name : Setup Ciao
@@ -64,39 +69,11 @@ jobs:
6469 exit 1
6570 fi
6671 }
67- test_equal "Wrong completion status" \
68- "${{ steps.setup-ciao.outcome }}" \
69- "success"
70- test_equal "ciao should not be installed" \
72+ test_equal "ciao should be installed" \
7173 "${{ steps.setup-ciao.outputs.installed }}" \
7274 "true"
7375 - name : Run command
7476 run : ciao list
75- windows-not-supported :
76- name : Windows not supported
77- runs-on : windows-latest
78- timeout-minutes : 5
79- steps :
80- - name : Checkout ${{ github.repository }}
81- uses : actions/checkout@v4
82- - name : Setup Ciao
83- id : setup-ciao
84- continue-on-error : true
85- uses : ./
86- - name : Test action completion
87- run : |
88- test_equal() {
89- if [ "${2}" != "${3}" ]; then
90- echo "::error title=${1}::Expected: ${3}. Actual: ${2}."
91- exit 1
92- fi
93- }
94- test_equal "Wrong completion status" \
95- "${{ steps.setup-ciao.outcome }}" \
96- "failure"
97- test_equal "ciao should not be installed" \
98- "${{ steps.setup-ciao.outputs.installed }}" \
99- "false"
10077 test-force :
10178 name : Test force
10279 runs-on : ubuntu-latest
0 commit comments