Fix "Windows workflow broken since recent commit" (#246)

This commit is contained in:
Paulo F. Oliveira
2024-01-28 18:52:46 +00:00
committed by GitHub
parent 4a641b1000
commit cf854bf149
9 changed files with 28 additions and 213 deletions
+5 -5
View File
@@ -197,9 +197,9 @@ jobs:
gleam-version: ${{matrix.combo.gleam-version}} gleam-version: ${{matrix.combo.gleam-version}}
rebar3-version: ${{matrix.combo.rebar3-version}} rebar3-version: ${{matrix.combo.rebar3-version}}
- run: env - run: env
- name: List environment variables - name: Check environment variables
run: | run: |
[ -n "${INSTALL_DIR_FOR_ELIXIR}" ] && echo "${INSTALL_DIR_FOR_ELIXIR}" ${INSTALL_DIR_FOR_ELIXIR}/elixir --version
[ -n "${INSTALL_DIR_FOR_GLEAM}" ] && echo "${INSTALL_DIR_FOR_GLEAM}" ${INSTALL_DIR_FOR_GLEAM}/gleam --version
[ -n "${INSTALL_DIR_FOR_OTP}" ] && echo "${INSTALL_DIR_FOR_OTP}" ${INSTALL_DIR_FOR_OTP}/erl -version
[ -n "${INSTALL_DIR_FOR_REBAR3}" ] && echo "${INSTALL_DIR_FOR_REBAR3}" ${INSTALL_DIR_FOR_REBAR3}/rebar3 version
+5 -5
View File
@@ -135,10 +135,10 @@ jobs:
gleam-version: ${{matrix.combo.gleam-version}} gleam-version: ${{matrix.combo.gleam-version}}
rebar3-version: ${{matrix.combo.rebar3-version}} rebar3-version: ${{matrix.combo.rebar3-version}}
- run: env - run: env
- name: List environment variables - name: Check environment variables
run: | run: |
[ -n "${INSTALL_DIR_FOR_ELIXIR}" ] && echo "${INSTALL_DIR_FOR_ELIXIR}" ${INSTALL_DIR_FOR_ELIXIR}/elixir --version
[ -n "${INSTALL_DIR_FOR_GLEAM}" ] && echo "${INSTALL_DIR_FOR_GLEAM}" ${INSTALL_DIR_FOR_GLEAM}/gleam --version
[ -n "${INSTALL_DIR_FOR_OTP}" ] && echo "${INSTALL_DIR_FOR_OTP}" ${INSTALL_DIR_FOR_OTP}/erl -version
[ -n "${INSTALL_DIR_FOR_REBAR3}" ] && echo "${INSTALL_DIR_FOR_REBAR3}" ${INSTALL_DIR_FOR_REBAR3}/rebar3 version
shell: bash shell: bash
-62
View File
@@ -1,62 +0,0 @@
{
"problemMatcher": [
{
"owner": "elixir-mixCompileError",
"severity": "error",
"pattern": [
{
"regexp": "^\\*\\* \\((\\w+)\\) (.*):(\\d+): (.*)$",
"file": 2,
"line": 3,
"message": 0
}
]
},
{
"owner": "elixir-mixCompileWarning",
"severity": "warning",
"pattern": [
{
"regexp": "^warning: (.*)$",
"message": 1
},
{
"regexp": "^ (.*):(\\d+).*$",
"file": 1,
"line": 2
}
]
},
{
"owner": "elixir-mixTestFailure",
"severity": "error",
"pattern": [
{
"regexp": "^\\s*\\d+\\) (.*)$",
"message": 1
},
{
"regexp": "^\\s*(.*):(\\d+)$",
"file": 1,
"line": 2
}
]
},
{
"owner": "elixir-credoOutputDefault",
"severity": "warning",
"pattern": [
{
"regexp": "^\u2503\\s\\[\\w\\]\\s[\u2191|\u2197|\u2192|\u2198|\u2193]\\s(.*)$",
"message": 1
},
{
"regexp": "^\u2503\\s{7}(.*):(\\d+):(\\d+)\\s.*$",
"file": 1,
"line": 2,
"column": 3
}
]
}
]
}
+9 -6
View File
@@ -10723,16 +10723,18 @@ async function install(toolName, opts) {
postExtract: async (cachePath) => { postExtract: async (cachePath) => {
const bindir = path.join(cachePath, 'bin') const bindir = path.join(cachePath, 'bin')
const oldPath = path.join(cachePath, 'rebar3') const oldPath = path.join(cachePath, 'rebar3')
const newPath = path.join(bindir, 'rebar3')
fs.mkdirSync(bindir) fs.mkdirSync(bindir)
fs.chmodSync(oldPath, 0o755) fs.renameSync(oldPath, newPath)
fs.chmodSync(newPath, 0o755)
const ps1Filename = path.join(bindir, 'rebar3.ps1') const ps1Filename = path.join(bindir, 'rebar3.ps1')
fs.writeFileSync(ps1Filename, `& escript.exe ${oldPath} \${args}`) fs.writeFileSync(ps1Filename, `& escript.exe ${newPath} \${args}`)
const cmdFilename = path.join(bindir, 'rebar3.cmd') const cmdFilename = path.join(bindir, 'rebar3.cmd')
fs.writeFileSync( fs.writeFileSync(
cmdFilename, cmdFilename,
`@echo off\r\nescript.exe ${oldPath} %*`, `@echo off\r\nescript.exe ${newPath} %*`,
) )
}, },
reportVersion: () => { reportVersion: () => {
@@ -10776,11 +10778,12 @@ async function installTool(opts) {
await platformOpts.postExtract(cachePath) await platformOpts.postExtract(cachePath)
core.debug(`Adding ${cachePath}'s bin to system path`) core.debug(`Adding ${cachePath}'s bin to system path`)
core.addPath(path.join(cachePath, 'bin')) const catchPathBin = path.join(cachePath, 'bin')
core.addPath(catchPathBin)
const installDirForVarName = `INSTALL_DIR_FOR_${toolName}`.toUpperCase() const installDirForVarName = `INSTALL_DIR_FOR_${toolName}`.toUpperCase()
core.debug(`Exporting ${installDirForVarName} as ${cachePath}`) core.debug(`Exporting ${installDirForVarName} as ${catchPathBin}`)
core.exportVariable(installDirForVarName, cachePath) core.exportVariable(installDirForVarName, catchPathBin)
core.info(`Installed ${installOpts.tool} version`) core.info(`Installed ${installOpts.tool} version`)
const [cmd, args] = platformOpts.reportVersion() const [cmd, args] = platformOpts.reportVersion()
-37
View File
@@ -1,37 +0,0 @@
param([Parameter(Mandatory=$true)][string]${VSN})
$ErrorActionPreference="Stop"
Set-Location ${Env:RUNNER_TEMP}
$FILE_OUTPUT="gleam.zip"
$DIR_FOR_BIN=".setup-beam/gleam"
function Version-Greater-Than([string]${THIS_ONE}, [string]${REFERENCE}) {
$THIS_ONE=$THIS_ONE.replace('v', '')
$THIS_ONE=$THIS_ONE.replace('rc', '')
$THIS_ONE=$THIS_ONE.replace('-', '')
return [version]${THIS_ONE} -gt [version]${REFERENCE}
}
function Uses-LLVM-Triplets([string]${THIS_VSN}) {
return "${THIS_VSN}" -eq "nightly" -or (Version-Greater-Than "${THIS_VSN}" "0.22.1")
}
if (Uses-LLVM-Triplets "$VSN") {
$FILE_INPUT="gleam-${VSN}-x86_64-pc-windows-msvc.zip"
} else {
$FILE_INPUT="gleam-${VSN}-windows-64bit.zip"
}
$ProgressPreference="SilentlyContinue"
Invoke-WebRequest "https://github.com/gleam-lang/gleam/releases/download/${VSN}/${FILE_INPUT}" -OutFile "${FILE_OUTPUT}"
$ProgressPreference="Continue"
New-Item "${DIR_FOR_BIN}/bin" -ItemType Directory | Out-Null
$ProgressPreference="SilentlyContinue"
Expand-Archive -DestinationPath "${DIR_FOR_BIN}/bin" -Path "${FILE_OUTPUT}"
$ProgressPreference="Continue"
Write-Output "Installed Gleam version follows"
& "${DIR_FOR_BIN}/bin/gleam" "--version" | Write-Output
"INSTALL_DIR_FOR_GLEAM=${Env:RUNNER_TEMP}/${DIR_FOR_BIN}" | Out-File -FilePath ${Env:GITHUB_ENV} -Encoding utf8 -Append
-35
View File
@@ -1,35 +0,0 @@
#!/bin/bash
set -eo pipefail
cd "${RUNNER_TEMP}"
VSN="$1"
FILE_OUTPUT=gleam.tar.gz
DIR_FOR_BIN=.setup-beam/gleam
version_gt() {
REFERENCE=$1
test "$(printf '%s\n' "$@" | sort -V | head -n 1)" != "$REFERENCE"
}
uses_llvm_triplets() {
local VERSION="$1"
test "${VERSION}" = "nightly" || version_gt "${VERSION}" "v0.22.1"
}
if uses_llvm_triplets "$VSN"
then
FILE_INPUT="gleam-${VSN}-x86_64-unknown-linux-musl.tar.gz"
else
FILE_INPUT="gleam-${VSN}-linux-amd64.tar.gz"
fi
wget -q -O "${FILE_OUTPUT}" "https://github.com/gleam-lang/gleam/releases/download/${VSN}/${FILE_INPUT}"
mkdir -p "${DIR_FOR_BIN}/bin"
tar zxf "${FILE_OUTPUT}" -C "${DIR_FOR_BIN}/bin"
echo "Installed Gleam version follows"
${DIR_FOR_BIN}/bin/gleam --version
echo "INSTALL_DIR_FOR_GLEAM=${RUNNER_TEMP}/${DIR_FOR_BIN}" >> "${GITHUB_ENV}"
-32
View File
@@ -1,32 +0,0 @@
param([Parameter(Mandatory=$true)][string]${VSN})
$ErrorActionPreference="Stop"
Set-Location ${Env:RUNNER_TEMP}
$FILE_INPUT="rebar3"
$FILE_OUTPUT="rebar3"
$FILE_OUTPUT_PS1="rebar3.ps1"
$FILE_OUTPUT_CMD="rebar3.cmd"
$DIR_FOR_BIN=".setup-beam/rebar3"
$ProgressPreference="SilentlyContinue"
$REBAR3_TARGET="https://github.com/erlang/rebar3/releases/download/${VSN}/${FILE_INPUT}"
$REBAR3_NIGHTLY=""
If ( ${VSN} -eq "nightly" )
{
$REBAR3_TARGET="https://s3.amazonaws.com/rebar3-nightly/rebar3"
$REBAR3_NIGHTLY=" (from nightly build)"
}
Invoke-WebRequest "${REBAR3_TARGET}" -OutFile "${FILE_OUTPUT}"
$ProgressPreference="Continue"
New-Item "${DIR_FOR_BIN}/bin" -ItemType Directory | Out-Null
Move-Item "${FILE_OUTPUT}" "${DIR_FOR_BIN}/bin"
Write-Output "& escript.exe ${PWD}/${DIR_FOR_BIN}/bin/${FILE_OUTPUT} `${args}" | Out-File -FilePath "${FILE_OUTPUT_PS1}" -Encoding utf8 -Append
Write-Output "@echo off`r`nescript.exe ${PWD}/${DIR_FOR_BIN}/bin/${FILE_OUTPUT} %*" | Out-File -FilePath "${FILE_OUTPUT_CMD}" -Encoding utf8 -Append
Move-Item "${FILE_OUTPUT_PS1}" "${DIR_FOR_BIN}/bin"
Move-Item "${FILE_OUTPUT_CMD}" "${DIR_FOR_BIN}/bin"
Write-Output "Installed rebar3 version${REBAR3_NIGHTLY} follows"
& "${DIR_FOR_BIN}/bin/rebar3.cmd" "version" | Write-Output
"INSTALL_DIR_FOR_REBAR3=${Env:RUNNER_TEMP}/${DIR_FOR_BIN}" | Out-File -FilePath ${Env:GITHUB_ENV} -Encoding utf8 -Append
-25
View File
@@ -1,25 +0,0 @@
#!/bin/bash
set -eo pipefail
cd "${RUNNER_TEMP}"
VSN=${1}
FILE_INPUT=rebar3
FILE_OUTPUT=rebar3
DIR_FOR_BIN=.setup-beam/rebar3
REBAR3_TARGET="https://github.com/erlang/rebar3/releases/download/${VSN}/${FILE_INPUT}"
REBAR3_NIGHTLY=""
if [ "${VSN}" == "nightly" ]; then
REBAR3_TARGET="https://s3.amazonaws.com/rebar3-nightly/rebar3"
REBAR3_NIGHTLY=" (from nightly build)"
fi
wget -q -O "${FILE_OUTPUT}" "${REBAR3_TARGET}"
mkdir -p "${DIR_FOR_BIN}/bin"
chmod +x "${FILE_OUTPUT}"
mv "${FILE_OUTPUT}" "${DIR_FOR_BIN}/bin"
echo "Installed rebar3 version${REBAR3_NIGHTLY} follows"
${DIR_FOR_BIN}/bin/rebar3 version
echo "INSTALL_DIR_FOR_REBAR3=${RUNNER_TEMP}/${DIR_FOR_BIN}" >> "${GITHUB_ENV}"
+9 -6
View File
@@ -903,16 +903,18 @@ async function install(toolName, opts) {
postExtract: async (cachePath) => { postExtract: async (cachePath) => {
const bindir = path.join(cachePath, 'bin') const bindir = path.join(cachePath, 'bin')
const oldPath = path.join(cachePath, 'rebar3') const oldPath = path.join(cachePath, 'rebar3')
const newPath = path.join(bindir, 'rebar3')
fs.mkdirSync(bindir) fs.mkdirSync(bindir)
fs.chmodSync(oldPath, 0o755) fs.renameSync(oldPath, newPath)
fs.chmodSync(newPath, 0o755)
const ps1Filename = path.join(bindir, 'rebar3.ps1') const ps1Filename = path.join(bindir, 'rebar3.ps1')
fs.writeFileSync(ps1Filename, `& escript.exe ${oldPath} \${args}`) fs.writeFileSync(ps1Filename, `& escript.exe ${newPath} \${args}`)
const cmdFilename = path.join(bindir, 'rebar3.cmd') const cmdFilename = path.join(bindir, 'rebar3.cmd')
fs.writeFileSync( fs.writeFileSync(
cmdFilename, cmdFilename,
`@echo off\r\nescript.exe ${oldPath} %*`, `@echo off\r\nescript.exe ${newPath} %*`,
) )
}, },
reportVersion: () => { reportVersion: () => {
@@ -956,11 +958,12 @@ async function installTool(opts) {
await platformOpts.postExtract(cachePath) await platformOpts.postExtract(cachePath)
core.debug(`Adding ${cachePath}'s bin to system path`) core.debug(`Adding ${cachePath}'s bin to system path`)
core.addPath(path.join(cachePath, 'bin')) const catchPathBin = path.join(cachePath, 'bin')
core.addPath(catchPathBin)
const installDirForVarName = `INSTALL_DIR_FOR_${toolName}`.toUpperCase() const installDirForVarName = `INSTALL_DIR_FOR_${toolName}`.toUpperCase()
core.debug(`Exporting ${installDirForVarName} as ${cachePath}`) core.debug(`Exporting ${installDirForVarName} as ${catchPathBin}`)
core.exportVariable(installDirForVarName, cachePath) core.exportVariable(installDirForVarName, catchPathBin)
core.info(`Installed ${installOpts.tool} version`) core.info(`Installed ${installOpts.tool} version`)
const [cmd, args] = platformOpts.reportVersion() const [cmd, args] = platformOpts.reportVersion()