Testing with db on Docker container #53
Workflow file for this run
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: Build Console application | |
on: | |
pull_request: | |
branches: [ "master" ] | |
env: | |
slnFile: 'src/ABulkCopy.sln' | |
consoleProjFile: 'src/ABulkCopy.Cmd/ABulkCopy.Cmd.csproj' | |
commonTest: 'src/Common.Test/Common.Test.csproj' | |
asqlserverTest: 'src/ASqlServer.Test/ASqlServer.Test.csproj' | |
apostgresTest: 'src/APostgres.Test/APostgres.Test.csproj' | |
aparserTest: 'src/AParser.Test/AParser.Test.csproj' | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
outputs: | |
currentVersion: v${{ steps.gitversion.outputs.SemVer }} | |
steps: | |
- name: Checkout all | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Install GitVersion | |
uses: gittools/actions/gitversion/[email protected] | |
with: | |
versionSpec: '5.x' | |
- name: Build | |
run: dotnet build ${{env.slnFile}} | |
- name: Determine version | |
id: gitversion | |
uses: gittools/actions/gitversion/[email protected] | |
with: | |
updateAssemblyInfo: true | |
useConfigFile: true | |
- name: Publish | |
run: dotnet publish ${{env.consoleProjFile}} -c Release | |
- name: Upload program artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: program | |
path: ./src/ABulkCopy.Cmd/bin/Release/net8.0/win-x64/publish | |
- name: Display structure of artifact files | |
run: ls -R | |
- name: Upload tests artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: tests | |
path: | | |
./src/AParser.Test/bin/Debug/net8.0 | |
./src/APostgres.Test/bin/Debug/net8.0 | |
./src/ASqlServer.Test/bin/Debug/net8.0 | |
./src/Common.Test/bin/Debug/net8.0 | |
./src/End2EndTests/bin/Debug/net8.0 | |
test: | |
name: Test | |
runs-on: ubuntu-latest | |
needs: build | |
outputs: | |
currentVersion: ${{ needs.build.outputs.currentVersion }} | |
steps: | |
- name: Download artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: tests | |
- name: Display structure of artifact files | |
run: ls -R | |
- name: Test AParser | |
run: dotnet test ./AParser.Test/bin/Debug/net8.0/AParser.Test.dll -v m | |
- name: Test Common | |
run: dotnet test ./Common.Test/bin/Debug/net8.0/Common.Test.dll -v m | |
- name: Test ASqlServer | |
run: dotnet test ./ASqlServer.Test/bin/Debug/net8.0/ASqlServer.Test.dll -v m -e AppSettings__ConnectionString="${{secrets.MSS_ABULKCOPY_TEST_CONNECTIONSTRING}}" | |
- name: SqlServer to Postgres end-to-end tests | |
run: dotnet test ./End2EndTests/bin/Debug/net8.0/End2EndTests.dll -v m | |
release: | |
name: Release | |
runs-on: ubuntu-latest | |
needs: test | |
env: | |
currentVersion: ${{ needs.test.outputs.currentVersion }} | |
steps: | |
- name: Download program artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: program | |
- name: Display structure of artifact files | |
run: ls -R | |
- name: Zip release files | |
uses: thedoctor0/[email protected] | |
with: | |
type: 'zip' | |
filename: 'release.zip' | |
- name: Create release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ env.currentVersion }} | |
release_name: Release ${{ env.currentVersion }} | |
body: | | |
You can find the release notes [here.](https://arveh.github.io/ABulkCopy.Docs/release_notes/) | |
draft: false | |
prerelease: true | |
- name: List files after zip and creating release | |
run: ls -R | |
- name: Upload Release Asset | |
id: upload-release-asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} # See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps | |
asset_path: ./release.zip | |
asset_name: release-${{ env.currentVersion }}.zip | |
asset_content_type: application/zip | |