Add environment variables (#94)

2494d08 · Paulo F. Oliveira · 2022-02-22 11:05

23 files +182 -82
Message
{commit_body(@commit)}

Files changed

modified .github/workflows/ubuntu.yml
+29 −0
@@ -149,3 +149,32 @@ jobs:
149 149 cd test-projects/gleam_gleam
150 150 gleam test
151 151 if: ${{ matrix.combo.gleam-version && matrix.combo.otp-version && !matrix.combo.rebar3-version }}
152 + environment_variables:
153 + name: Environment variables
154 + runs-on: ${{matrix.combo.os}}
155 + strategy:
156 + fail-fast: false
157 + matrix:
158 + combo:
159 + - otp-version: '24'
160 + elixir-version: 'v1.12'
161 + gleam-version: '0.19'
162 + rebar3-version: 'nightly'
163 + os: 'ubuntu-latest'
164 + steps:
165 + - uses: actions/checkout@v2
166 + - name: Use erlef/setup-beam
167 + id: setup-beam
168 + uses: ./
169 + with:
170 + otp-version: ${{matrix.combo.otp-version}}
171 + elixir-version: ${{matrix.combo.elixir-version}}
172 + gleam-version: ${{matrix.combo.gleam-version}}
173 + rebar3-version: ${{matrix.combo.rebar3-version}}
174 + - run: env
175 + - name: List environment variables
176 + run: |
177 + echo "${{env.INSTALL_DIR_FOR_ELIXIR}}"
178 + echo "${{env.INSTALL_DIR_FOR_GLEAM}}"
179 + echo "${{env.INSTALL_DIR_FOR_OTP}}"
180 + echo "${{env.INSTALL_DIR_FOR_REBAR3}}"
modified .github/workflows/windows.yml
+29 −0
@@ -84,3 +84,32 @@ jobs:
84 84 cd test-projects/gleam_rebar3
85 85 rebar3 eunit
86 86 if: ${{matrix.combo.gleam-version}}
87 + environment_variables:
88 + name: Environment variables
89 + runs-on: ${{matrix.combo.os}}
90 + strategy:
91 + fail-fast: false
92 + matrix:
93 + combo:
94 + - otp-version: '24'
95 + elixir-version: 'v1.12'
96 + gleam-version: '0.19'
97 + rebar3-version: 'nightly'
98 + os: 'windows-latest'
99 + steps:
100 + - uses: actions/checkout@v2
101 + - name: Use erlef/setup-beam
102 + id: setup-beam
103 + uses: ./
104 + with:
105 + otp-version: ${{matrix.combo.otp-version}}
106 + elixir-version: ${{matrix.combo.elixir-version}}
107 + gleam-version: ${{matrix.combo.gleam-version}}
108 + rebar3-version: ${{matrix.combo.rebar3-version}}
109 + - run: env
110 + - name: List environment variables
111 + run: |
112 + echo "${{env.INSTALL_DIR_FOR_ELIXIR}}"
113 + echo "${{env.INSTALL_DIR_FOR_GLEAM}}"
114 + echo "${{env.INSTALL_DIR_FOR_OTP}}"
115 + echo "${{env.INSTALL_DIR_FOR_REBAR3}}"
modified README.md
+10 −0
@@ -187,6 +187,16 @@ jobs:
187 187
188 188 **Note**: the `otp-version: false` input is only applicable when installing Gleam.
189 189
190 +## Environment variables
191 +
192 +Base installation folders (useful for e.g. fetching headers for NIFs) are available in the following
193 +environment variables:
194 +
195 +- `INSTALL_DIR_FOR_ELIXIR`: base folder for Erlang/OTP
196 +- `INSTALL_DIR_FOR_GLEAM`: base folder for Elixir
197 +- `INSTALL_DIR_FOR_OTP`: base folder for Gleam
198 +- `INSTALL_DIR_FOR_REBAR3`: base folder for `rebar3`
199 +
190 200 ## Elixir Problem Matchers
191 201
192 202 The Elixir Problem Matchers in this repository are adapted from
modified dist/install-elixir.ps1
+7 −5
@@ -1,19 +1,21 @@
1 param([Parameter(Mandatory=$true)][string]$VSN)
1 +param([Parameter(Mandatory=$true)][string]${VSN})
2 2
3 3 $ErrorActionPreference="Stop"
4 4
5 Set-Location $Env:RUNNER_TEMP
5 +Set-Location ${Env:RUNNER_TEMP}
6 6
7 7 $FILE_INPUT="${VSN}.zip"
8 8 $FILE_OUTPUT="elixir.zip"
9 9 $DIR_FOR_BIN=".setup-beam/elixir"
10 10
11 11 $ProgressPreference="SilentlyContinue"
12 Invoke-WebRequest "https://repo.hex.pm/builds/elixir/${FILE_INPUT}" -OutFile "$FILE_OUTPUT"
12 +Invoke-WebRequest "https://repo.hex.pm/builds/elixir/${FILE_INPUT}" -OutFile "${FILE_OUTPUT}"
13 13 $ProgressPreference="Continue"
14 New-Item "$DIR_FOR_BIN" -ItemType Directory | Out-Null
14 +New-Item "${DIR_FOR_BIN}" -ItemType Directory | Out-Null
15 15 $ProgressPreference="SilentlyContinue"
16 16 Expand-Archive -DestinationPath "${DIR_FOR_BIN}" -Path "${FILE_OUTPUT}"
17 17 $ProgressPreference="Continue"
18 18 Write-Output "Installed Elixir version follows"
19 & "$DIR_FOR_BIN/bin/elixir" "-v" | Write-Output
19 +& "${DIR_FOR_BIN}/bin/elixir" "-v" | Write-Output
20 +
21 +"INSTALL_DIR_FOR_ELIXIR=${Env:RUNNER_TEMP}/${DIR_FOR_BIN}" | Out-File -FilePath ${Env:GITHUB_ENV} -Encoding utf8 -Append
modified dist/install-elixir.sh
+3 −1
@@ -2,7 +2,7 @@
2 2
3 3 set -eo pipefail
4 4
5 cd "$RUNNER_TEMP"
5 +cd "${RUNNER_TEMP}"
6 6
7 7 VSN=${1}
8 8 FILE_INPUT="${VSN}.zip"
@@ -14,3 +14,5 @@ mkdir -p "${DIR_FOR_BIN}"
14 14 unzip -q -d "${DIR_FOR_BIN}" "${FILE_OUTPUT}"
15 15 echo "Installed Elixir version follows"
16 16 ${DIR_FOR_BIN}/bin/elixir -v
17 +
18 +echo "INSTALL_DIR_FOR_ELIXIR=${RUNNER_TEMP}/${DIR_FOR_BIN}" >> "${GITHUB_ENV}"
modified dist/install-gleam.ps1
+9 −7

Click to load diff…

modified dist/install-gleam.sh
+7 −5

Click to load diff…

modified dist/install-otp.ps1
+11 −9

Click to load diff…

modified dist/install-otp.sh
+3 −1

Click to load diff…

modified dist/install-rebar3.ps1
+13 −11

Click to load diff…

modified dist/install-rebar3.sh
+4 −2

Click to load diff…

modified src/install-elixir.ps1
+7 −5

Click to load diff…

modified src/install-elixir.sh
+3 −1

Click to load diff…

modified src/install-gleam.ps1
+9 −7

Click to load diff…

modified src/install-gleam.sh
+7 −5

Click to load diff…

modified src/install-otp.ps1
+11 −9

Click to load diff…

modified src/install-otp.sh
+3 −1

Click to load diff…

modified src/install-rebar3.ps1
+13 −11

Click to load diff…

modified src/install-rebar3.sh
+4 −2

Click to load diff…

Parents: b28629c