Skip to content

Update codecov/codecov-action action to v4 - autoclosed #48

Update codecov/codecov-action action to v4 - autoclosed

Update codecov/codecov-action action to v4 - autoclosed #48

Workflow file for this run

name: E2E
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
no-line-ending-given:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
package: [all-have-licenses, missing-license-file]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 16
registry-url: https://registry.npmjs.org/
- name: npm install
run : npm ci
- name: npm install test project
run : npm ci
working-directory: ./e2e/test-projects/${{ matrix.package }}
- name: Run generate-license-file
uses: ./
with:
input: './e2e/test-projects/${{ matrix.package }}/package.json'
output: './e2e/test-projects/${{ matrix.package }}/${{ github.job }}.txt'
- name: Assert generated output
shell: pwsh
run: |
$expectedLineEnding = "${{ matrix.os }}" -eq "windows-latest" ? "crlf" : "lf";
$expectedHash = (Get-FileHash "./e2e/test-projects/${{ matrix.package }}/expected-results/$expectedLineEnding.txt").Hash;
$actualHash = (Get-FileHash "./e2e/test-projects/${{ matrix.package }}/${{ github.job }}.txt").Hash;
Write-Host "Expected: $expectedHash";
Write-Host "Actual: $actualHash";
exit($expectedHash -eq $actualHash ? 0 : 1)
windows-line-ending-given:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
package: [all-have-licenses, missing-license-file]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 16
registry-url: https://registry.npmjs.org/
- name: npm install
run : npm ci
- name: npm install test project
run : npm ci
working-directory: ./e2e/test-projects/${{ matrix.package }}
- name: Run generate-license-file
uses: ./
with:
input: './e2e/test-projects/${{ matrix.package }}/package.json'
output: './e2e/test-projects/${{ matrix.package }}/${{ github.job }}.txt'
lineEnding: 'windows'
- name: Assert generated output
shell: pwsh
run: |
$expectedHash = (Get-FileHash "./e2e/test-projects/${{ matrix.package }}/expected-results/crlf.txt").Hash;
$actualHash = (Get-FileHash "./e2e/test-projects/${{ matrix.package }}/${{ github.job }}.txt").Hash;
Write-Host "Expected: $expectedHash";
Write-Host "Actual: $actualHash";
exit($expectedHash -eq $actualHash ? 0 : 1)
posix-line-ending-given:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
package: [all-have-licenses, missing-license-file]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 16
registry-url: https://registry.npmjs.org/
- name: npm install
run : npm ci
- name: npm install test project
run : npm ci
working-directory: ./e2e/test-projects/${{ matrix.package }}
- name: Run generate-license-file
uses: ./
with:
input: './e2e/test-projects/${{ matrix.package }}/package.json'
output: './e2e/test-projects/${{ matrix.package }}/${{ github.job }}.txt'
lineEnding: 'posix'
- name: Assert generated output
shell: pwsh
run: |
$expectedHash = (Get-FileHash "./e2e/test-projects/${{ matrix.package }}/expected-results/lf.txt").Hash;
$actualHash = (Get-FileHash "./e2e/test-projects/${{ matrix.package }}/${{ github.job }}.txt").Hash;
Write-Host "Expected: $expectedHash";
Write-Host "Actual: $actualHash";
exit($expectedHash -eq $actualHash ? 0 : 1)