11# SPDX-License-Identifier: Apache-2.0
22# SPDX-FileCopyrightText: 2021 The Elixir Team
3+ # SPDX-FileCopyrightText: 2012 Plataformatec
34
45name : CI
56
67on :
78 push :
89 paths-ignore :
910 - " lib/**/*.md"
11+
1012 pull_request :
1113 paths-ignore :
1214 - " lib/**/*.md"
@@ -21,7 +23,9 @@ permissions:
2123
2224jobs :
2325 test_linux :
24- name : Ubuntu 24.04, Erlang/OTP ${{ matrix.otp_version }}${{ matrix.deterministic && ' (deterministic)' || '' }}${{ matrix.coverage && ' (coverage)' || '' }}
26+ name : Ubuntu 24.04, OTP ${{ matrix.otp_version }}${{ matrix.deterministic && ' (deterministic)' || '' }}${{ matrix.coverage && ' (coverage)' || '' }}
27+ runs-on : ubuntu-24.04
28+
2529 strategy :
2630 fail-fast : false
2731 matrix :
3034 deterministic : true
3135 - otp_version : " 28.1"
3236 erlc_opts : " warnings_as_errors"
37+ docs : true
3338 coverage : true
34- - otp_version : " 28.1"
35- otp_latest : true
36- erlc_opts : " warnings_as_errors"
3739 - otp_version : " 27.3"
3840 erlc_opts : " warnings_as_errors"
3941 - otp_version : " 27.0"
@@ -43,44 +45,46 @@ jobs:
4345 development : true
4446 - otp_version : maint
4547 development : true
46- runs-on : ubuntu-24.04
48+
4749 # Earlier Erlang/OTP versions ignored compiler directives
4850 # when using warnings_as_errors. So we only set ERLC_OPTS
4951 # from Erlang/OTP 27+.
5052 env :
5153 ERLC_OPTS : ${{ matrix.erlc_opts || '' }}
5254 steps :
53- - uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
54- with :
55- fetch-depth : 50
55+ - uses : actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
56+
5657 - uses : erlef/setup-beam@e6d7c94229049569db56a7ad5a540c051a010af9 # v1.20.4
5758 with :
5859 otp-version : ${{ matrix.otp_version }}
5960 gleam-version : " 1.11.1"
6061 - name : Set ERL_COMPILER_OPTIONS
6162 if : ${{ matrix.deterministic }}
6263 run : echo "ERL_COMPILER_OPTIONS=deterministic" >> $GITHUB_ENV
64+
6365 - name : Compile Elixir
6466 run : |
6567 make compile
6668 echo "$PWD/bin" >> $GITHUB_PATH
69+
6770 - name : Build info
6871 run : bin/elixir --version
72+
6973 - name : Check format
7074 run : make test_formatted && echo "All Elixir source code files are properly formatted."
75+
7176 - name : Erlang test suite
7277 run : make test_erlang
73- continue-on-error : ${{ matrix.development }}
78+ continue-on-error : ${{ matrix.development == true }}
79+
7480 - name : Elixir test suite
7581 run : make test_elixir
76- continue-on-error : ${{ matrix.development }}
82+ continue-on-error : ${{ matrix.development == true }}
7783 env :
7884 COVER : " ${{ matrix.coverage }}"
79- - name : " Calculate Coverage"
80- run : make cover | tee "$GITHUB_STEP_SUMMARY"
81- if : " ${{ matrix.coverage }}"
85+
8286 - name : Build docs (ExDoc main)
83- if : ${{ matrix.otp_latest }}
87+ if : ${{ matrix.docs }}
8488 run : |
8589 cd ..
8690 git clone https://github.com/elixir-lang/ex_doc.git --depth 1
@@ -89,67 +93,66 @@ jobs:
8993 cd ../elixir/
9094 git fetch --tags
9195 DOCS_OPTIONS="--warnings-as-errors" make docs
96+
97+ - name : " Calculate Coverage"
98+ if : ${{ matrix.coverage }}
99+ run : make cover | tee "$GITHUB_STEP_SUMMARY"
100+
101+ - name : " Upload Coverage Artifact"
102+ if : ${{ matrix.coverage }}
103+ uses : actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
104+ with :
105+ name : TestCoverage
106+ path : cover/*
107+
92108 - name : Check reproducible builds
93109 if : ${{ matrix.deterministic }}
94110 run : |
95111 rm -rf .git
96112 # Recompile System without .git
97113 cd lib/elixir && ../../bin/elixirc -o ebin lib/system.ex && cd -
98114 taskset 1 make check_reproducible
99- - name : " Upload Coverage Artifact"
100- if : " ${{ matrix.coverage }}"
101- uses : actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
102- with :
103- name : TestCoverage
104- path : cover/*
105115
106116 test_windows :
107- name : Windows Server 2019, Erlang/OTP ${{ matrix.otp_version }}
117+ name : Windows Server 2022, OTP ${{ matrix.otp_version }}
118+ runs-on : windows-2022
119+
108120 strategy :
109121 matrix :
110- otp_version : ["26.2", "27.3", "28.1"]
111- runs-on : windows-2022
122+ otp_version :
123+ - " 28.1"
124+ - " 27.3"
125+ - " 26.2"
126+
112127 steps :
113128 - name : Configure Git
114129 run : git config --global core.autocrlf input
115- - uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
116- with :
117- fetch-depth : 50
130+
131+ - uses : actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
132+
118133 - uses : erlef/setup-beam@e6d7c94229049569db56a7ad5a540c051a010af9 # v1.20.4
119134 with :
120135 otp-version : ${{ matrix.otp_version }}
136+
121137 - name : Compile Elixir
122138 run : |
123139 Remove-Item -Recurse -Force '.git'
124140 make compile
141+
125142 - name : Build info
126143 run : bin/elixir --version
144+
127145 - name : Check format
128146 run : make test_formatted && echo "All Elixir source code files are properly formatted."
147+
129148 - name : Erlang test suite
130149 run : make test_erlang
150+
131151 - name : Elixir test suite
132152 run : |
133153 Remove-Item 'c:/Windows/System32/drivers/etc/hosts'
134154 make test_elixir
135155
136- check_posix_compliant :
137- name : Check POSIX-compliant
138- runs-on : ubuntu-24.04
139- steps :
140- - uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
141- with :
142- fetch-depth : 50
143- - name : Install Shellcheck
144- run : |
145- sudo apt update
146- sudo apt install -y shellcheck
147- - name : Check POSIX-compliant
148- run : |
149- shellcheck -e SC2039,2086 bin/elixir && echo "bin/elixir is POSIX compliant"
150- shellcheck bin/elixirc && echo "bin/elixirc is POSIX compliant"
151- shellcheck bin/iex && echo "bin/iex is POSIX compliant"
152-
153156 license_compliance :
154157 name : Check Licence Compliance
155158
@@ -163,7 +166,7 @@ jobs:
163166
164167 - name : Checkout project
165168 id : checkout
166- uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 .0.0
169+ uses : actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6 .0.0
167170
168171 - name : " Run OSS Review Toolkit"
169172 id : ort
0 commit comments