Integration Tests #71
This file contains 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: Integration Tests | |
on: | |
workflow_dispatch: | |
inputs: | |
pr_number: | |
type: number | |
required: true | |
jobs: | |
build-for-e2e-test: | |
strategy: | |
fail-fast: false | |
matrix: | |
target-os: [windows-latest, ubuntu-latest, macos-latest] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v2 | |
with: | |
global-json-file: global.json | |
- name: Build Artifacts (Linux) | |
if: matrix.target-os == 'ubuntu-latest' | |
run: ./publish.ps1 | |
shell: pwsh | |
env: | |
SKIP_WINDOWS: "true" | |
SKIP_MACOS: "true" | |
- name: Build Artifacts (Windows) | |
if: matrix.target-os == 'windows-latest' | |
run: ./publish.ps1 | |
shell: pwsh | |
env: | |
SKIP_LINUX: "true" | |
SKIP_MACOS: "true" | |
- name: Build Artifacts (MacOS) | |
if: matrix.target-os == 'macos-latest' | |
run: ./publish.ps1 | |
shell: pwsh | |
env: | |
SKIP_WINDOWS: "true" | |
SKIP_LINUX: "true" | |
- name: Upload Binaries | |
uses: actions/upload-artifact@v3 | |
with: | |
name: binaries-${{ matrix.target-os }} | |
path: | | |
dist/linux-x64/ado2gh-linux-amd64 | |
dist/linux-x64/bbs2gh-linux-amd64 | |
dist/linux-x64/gei-linux-amd64 | |
dist/osx-x64/ado2gh-darwin-amd64 | |
dist/osx-x64/bbs2gh-darwin-amd64 | |
dist/osx-x64/gei-darwin-amd64 | |
dist/win-x64/ado2gh-windows-amd64.exe | |
dist/win-x64/bbs2gh-windows-amd64.exe | |
dist/win-x64/gei-windows-amd64.exe | |
e2e-test: | |
needs: [ build-for-e2e-test ] | |
strategy: | |
matrix: | |
runner-os: [windows-latest, ubuntu-latest, macos-latest] | |
source-vcs: [AdoBasic, AdoCsv, Bbs, Ghes, Github] | |
runs-on: ${{ matrix.runner-os }} | |
concurrency: integration-test-${{ matrix.source-vcs }}-${{ matrix.runner-os }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: 'refs/pull/${{ github.event.inputs.pr_number }}/merge' | |
fetch-depth: 0 | |
- name: Get PR Commit | |
if: always() && matrix.runner-os == 'ubuntu-latest' | |
run: | | |
prsha=`git ls-remote origin refs/pull/${{ github.event.inputs.pr_number }}/head | awk '{ print $1 }'` | |
echo "SHA: $prsha" | |
echo "PR_SHA=$(echo $prsha)" >> $GITHUB_ENV | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v2 | |
with: | |
global-json-file: global.json | |
- name: Download Binaries | |
uses: actions/download-artifact@v3 | |
with: | |
name: binaries-${{ matrix.runner-os }} | |
path: dist | |
- name: Copy binary to root (linux) | |
if: matrix.runner-os == 'ubuntu-latest' | |
run: | | |
New-Item -Path "./" -Name "gh-gei" -ItemType "directory" | |
New-Item -Path "./" -Name "gh-ado2gh" -ItemType "directory" | |
New-Item -Path "./" -Name "gh-bbs2gh" -ItemType "directory" | |
Copy-Item ./dist/linux-x64/gei-linux-amd64 ./gh-gei/gh-gei | |
Copy-Item ./dist/linux-x64/ado2gh-linux-amd64 ./gh-ado2gh/gh-ado2gh | |
Copy-Item ./dist/linux-x64/bbs2gh-linux-amd64 ./gh-bbs2gh/gh-bbs2gh | |
shell: pwsh | |
- name: Copy binary to root (windows) | |
if: matrix.runner-os == 'windows-latest' | |
run: | | |
New-Item -Path "./" -Name "gh-gei" -ItemType "directory" | |
New-Item -Path "./" -Name "gh-ado2gh" -ItemType "directory" | |
New-Item -Path "./" -Name "gh-bbs2gh" -ItemType "directory" | |
Copy-Item ./dist/win-x64/gei-windows-amd64.exe ./gh-gei/gh-gei.exe | |
Copy-Item ./dist/win-x64/ado2gh-windows-amd64.exe ./gh-ado2gh/gh-ado2gh.exe | |
Copy-Item ./dist/win-x64/bbs2gh-windows-amd64.exe ./gh-bbs2gh/gh-bbs2gh.exe | |
shell: pwsh | |
- name: Copy binary to root (macos) | |
if: matrix.runner-os == 'macos-latest' | |
run: | | |
New-Item -Path "./" -Name "gh-gei" -ItemType "directory" | |
New-Item -Path "./" -Name "gh-ado2gh" -ItemType "directory" | |
New-Item -Path "./" -Name "gh-bbs2gh" -ItemType "directory" | |
Copy-Item ./dist/osx-x64/gei-darwin-amd64 ./gh-gei/gh-gei | |
Copy-Item ./dist/osx-x64/ado2gh-darwin-amd64 ./gh-ado2gh/gh-ado2gh | |
Copy-Item ./dist/osx-x64/bbs2gh-darwin-amd64 ./gh-bbs2gh/gh-bbs2gh | |
shell: pwsh | |
- name: Set execute permissions | |
run: | | |
chmod +x ./gh-gei/gh-gei | |
chmod +x ./gh-ado2gh/gh-ado2gh | |
chmod +x ./gh-bbs2gh/gh-bbs2gh | |
- name: Install gh-gei extension | |
run: gh extension install . | |
shell: pwsh | |
working-directory: ./gh-gei | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Install gh-ado2gh extension | |
run: gh extension install . | |
shell: pwsh | |
working-directory: ./gh-ado2gh | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Install gh-bbs2gh extension | |
run: gh extension install . | |
shell: pwsh | |
working-directory: ./gh-bbs2gh | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Integration Test | |
env: | |
ADO_PAT: ${{ secrets.ADO_PAT }} | |
GHEC_PAT: ${{ secrets.GHEC_PAT }} | |
GHES_PAT: ${{ secrets.GHES_PAT }} | |
ADO_SERVER_PAT: ${{ secrets.ADO_SERVER_PAT }} | |
BBS_USERNAME: ${{ secrets.BBS_USERNAME }} | |
BBS_PASSWORD: ${{ secrets.BBS_PASSWORD }} | |
SSH_KEY_BBS_8_5_0: ${{ secrets.SSH_KEY_BBS_8_5_0 }} | |
SSH_KEY_BBS_5_14_0: ${{ secrets.SSH_KEY_BBS_5_14_0 }} | |
SMB_PASSWORD: ${{ secrets.SMB_PASSWORD }} | |
AZURE_STORAGE_CONNECTION_STRING_BBS_LINUX: ${{ secrets.AZURE_STORAGE_CONNECTION_STRING_BBS_LINUX }} | |
AZURE_STORAGE_CONNECTION_STRING_BBS_MACOS: ${{ secrets.AZURE_STORAGE_CONNECTION_STRING_BBS_MACOS }} | |
AZURE_STORAGE_CONNECTION_STRING_BBS_WINDOWS: ${{ secrets.AZURE_STORAGE_CONNECTION_STRING_BBS_WINDOWS }} | |
AZURE_STORAGE_CONNECTION_STRING_GHES_LINUX: ${{ secrets.AZURE_STORAGE_CONNECTION_STRING_GHES_LINUX }} | |
AZURE_STORAGE_CONNECTION_STRING_GHES_MACOS: ${{ secrets.AZURE_STORAGE_CONNECTION_STRING_GHES_MACOS }} | |
AZURE_STORAGE_CONNECTION_STRING_GHES_WINDOWS: ${{ secrets.AZURE_STORAGE_CONNECTION_STRING_GHES_WINDOWS }} | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
GEI_DEBUG_MODE: 'true' | |
LD_LIBRARY_PATH: '$LD_LIBRARY_PATH:${{ github.workspace }}/src/OctoshiftCLI.IntegrationTests/bin/Debug/net6.0/runtimes/ubuntu.18.04-x64/native' | |
run: dotnet test src/OctoshiftCLI.IntegrationTests/OctoshiftCLI.IntegrationTests.csproj --filter "${{ matrix.source-vcs }}ToGithub" --logger:"junit;LogFilePath=integration-tests.xml" /p:VersionPrefix=9.9 | |
- name: Publish Integration Test Results | |
uses: EnricoMi/publish-unit-test-result-action@v2 | |
if: always() && matrix.runner-os == 'ubuntu-latest' | |
with: | |
files: "**/*-tests.xml" | |
check_name: "Integration Test Results - ${{ matrix.source-vcs }}" | |
comment_mode: off | |
commit: ${{ env.PR_SHA }} | |
- name: Upload test logs | |
uses: actions/upload-artifact@v3 | |
if: always() | |
with: | |
name: integration-test-logs-${{ matrix.source-vcs }}-${{ matrix.runner-os }} | |
path: dist/**/*.log | |
- name: Test Logs | |
if: always() | |
run: Get-ChildItem . -Filter *.octoshift.log -Recurse | ForEach-Object { Get-Content -Path $_.FullName } | |
working-directory: ./dist | |
shell: pwsh | |
- name: Test Logs (Verbose) | |
if: always() | |
run: Get-ChildItem . -Filter *.octoshift.verbose.log -Recurse | ForEach-Object { Get-Content -Path $_.FullName } | |
working-directory: ./dist | |
shell: pwsh |