Skip to content

Commit

Permalink
Tweaks for windows compatibility, remove some duplication
Browse files Browse the repository at this point in the history
  • Loading branch information
sgb-io committed Jul 16, 2023
1 parent 7a72dda commit 077df5a
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,23 +86,32 @@ jobs:
name: ${{ matrix.artifact }}
path: artifact/

- name: Extract artifact
- name: Extract artifact (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
foreach ($file in Get-ChildItem artifact/*) {
& 7z e $file -oartifact
}
- name: Extract artifact - (Linux/MacOS)
if: runner.os != 'Windows'
shell: bash
run: |
for file in artifact/*; do
${{ matrix.extract }} "$file"
done
- name: Create sample folder and copy foo.ts
shell: bash
run: |
rm -rf sample
mkdir sample
cp ./.github/foo.ts sample/
cp ./.github/foo.ts sample/foo.ts
- name: Test binary
shell: bash
run: |
rm -rf sample
mkdir sample
cp ./.github/foo.ts sample/foo.ts
EXPECTED_OUTPUT=$(cat <<'EOF'
[{"file_name":"foo.ts","cyclo":3,"halstead":{"uniq_operators":13,"uniq_operands":21,"total_operators":39,"total_operands":44,"program_length":34,"vocabulary_size":83,"volume":216.75134066579542,"difficulty":9.068181818181818,"effort":1965.5405664920995,"time":109.19669813844997,"bugs":0.07225044688859847},"line_count":23,"fta_score":42.65462143345264,"assessment":"OK"}]
EOF
Expand Down

0 comments on commit 077df5a

Please sign in to comment.