Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix windows EINVAL error #44

Merged
merged 3 commits into from
Apr 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Build

on:
workflow_dispatch:
pull_request:
branches:
- "*"
push:
branches:
- "main"
- "hotfix-*"

jobs:
build:
strategy:
fail-fast: false
matrix:
node-version: [ 18, 20, 21 ]
os: [ ubuntu-latest, windows-latest, macos-latest ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
registry-url: https://registry.npmjs.org/
- run: npm ci
- name: "Fetch & Unpack Allure Commandline from Maven Central"
run: ./fetch-source.sh
if: runner.os != 'Windows'
- name: "Fetch & Unpack Allure Commandline from Maven Central"
run: powershell -ExecutionPolicy Bypass -File fetch-source.ps1
if: runner.os == 'Windows'
- run: npm link
- run: allure --version
4 changes: 2 additions & 2 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ jobs:
publish-npm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 12
registry-url: https://registry.npmjs.org/
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
run: |
expr "${{ github.event.inputs.releaseVersion }}" : '\(^[1-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\(-beta\.[1-9][0-9]*\)\{0,1\}\)$'

- uses: actions/checkout@v2.4.0
- uses: actions/checkout@v4
with:
token: ${{ secrets.QAMETA_CI }}

Expand All @@ -25,7 +25,7 @@ jobs:
git config --global user.name qameta-ci
git config --global user.email [email protected]

- uses: actions/setup-node@v2
- uses: actions/setup-node@v4
with:
node-version: 14

Expand Down
27 changes: 27 additions & 0 deletions fetch-source.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Get version from package.json
$version = (Get-Content "package.json" -Raw | ConvertFrom-Json).version

# Remove dist directory if it exists and create a new one
if(Test-Path -Path dist) {
Remove-Item -Path dist -Recurse -Force
}
New-Item -ItemType Directory -Path dist | Out-Null

# Remove allure-commandline.zip if it exists
if(Test-Path -Path allure-commandline.zip) {
Remove-Item -Path allure-commandline.zip -Force
}

# Download allure-commandline.zip from Maven repository
Invoke-WebRequest -Uri "https://repo.maven.apache.org/maven2/io/qameta/allure/allure-commandline/$version/allure-commandline-$version.zip" -OutFile allure-commandline.zip

# Extract allure-commandline.zip to dist directory
Add-Type -AssemblyName System.IO.Compression.FileSystem
[System.IO.Compression.ZipFile]::ExtractToDirectory('allure-commandline.zip', 'dist')

# Same as --strip-components=1 of tar
Move-Item "dist\allure-$version\*" "dist"
Remove-Item "dist\allure-$version\*"

# List files in current directory
Get-ChildItem -Path .
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ var allureCommand = 'allure' + (isWindows ? '.bat' : '');
module.exports = function(args) {
return require('child_process').spawn(path.join(__dirname, 'dist/bin', allureCommand), args, {
env: process.env,
stdio: 'inherit'
stdio: 'inherit',
shell: true,
});
}
16 changes: 14 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"index.js"
],
"scripts": {
"test": "./bin/allure --version"
"test": "node ./bin/allure --version"
},
"repository": "https://github.com/allure-framework/allure-npm.git",
"license": "Apache-2.0",
Expand Down