-
-
Notifications
You must be signed in to change notification settings - Fork 89
37 lines (34 loc) · 1.38 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
name: Exercism Erlang Track verification
on: [push, pull_request]
jobs:
create_otp_matrix:
name: Generate a list of last OTP versions
runs-on: ubuntu-22.04
outputs:
otps: ${{ steps.versions.outputs.versions }}
steps:
- name: Clone the repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
- name: Get latest OTP versions
id: versions
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
all_versions=$(gh api graphql -f query='query { repository(owner: "erlang", name: "otp") { releases(last: 100, orderBy: {field: CREATED_AT, direction: ASC}) { nodes { tagName } } } }' --jq '.data.repository.releases.nodes[].tagName | select(. | contains("rc") | not) | .[4:8]' | sort -u -n)
latest_versions=$(./bin/get_latest_majors_for_ci_matrix.py <<< "$all_versions")
printf "::set-output name=versions::%s" "$latest_versions"
test_erlang:
name: Test examples against OTP ${{ matrix.otp }}
runs-on: ubuntu-22.04
needs: [create_otp_matrix]
strategy:
matrix:
otp: ${{fromJson(needs.create_otp_matrix.outputs.otps)}}
container:
image: erlang:${{ matrix.otp }}
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
- name: Install dependencies
run: apt update && apt install --yes jq
- name: run tests
run: ./bin/run_ci.sh