Update jest monorepo (major) #101
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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) |