From 68da57c4d3f64c084700aa1b8094891f2bfd524d Mon Sep 17 00:00:00 2001 From: Enkidu93 Date: Fri, 1 Sep 2023 09:55:49 -0400 Subject: [PATCH] Fixes https://github.com/sillsdev/serval/issues/100 -- ECL --- .github/workflows/ci-e2e.yml | 64 ++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 .github/workflows/ci-e2e.yml diff --git a/.github/workflows/ci-e2e.yml b/.github/workflows/ci-e2e.yml new file mode 100644 index 000000000..cd107444d --- /dev/null +++ b/.github/workflows/ci-e2e.yml @@ -0,0 +1,64 @@ +name: "CI Build: E2E tests" + +on: + push: + branches: ["run_e2etests_on_release_#100"] + release: + types: [published] + workflow_dispatch: + +jobs: + build: + name: Build + runs-on: ubuntu-latest + timeout-minutes: 15 + + env: + SERVAL_CLIENT_ID: ${{ secrets.SERVAL_CLIENT_ID }} + SERVAL_CLIENT_SECRET: ${{ secrets.SERVAL_CLIENT_SECRET }} + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + ClearML_AccessKey: ${{ secrets.CLEARML_ACCESSKEY }} + ClearML_SecretKey: ${{ secrets.CLEARML_SECRETKEY }} + SERVAL_HOST_URL: http://localhost + SERVAL_AUTH_URL: https://sil-appbuilder.auth0.com + + steps: + - uses: actions/checkout@v3 + + - name: Setup .NET + uses: actions/setup-dotnet@v3 + with: + dotnet-version: 6.0.x + + - name: Get Machine + run: dotnet build && cd .. && git clone https://github.com/sillsdev/serval.git && cd serval && dotnet build + + - name: Restore dotnet tools + run: dotnet tool restore + + - name: Restore dependencies + run: dotnet restore + + - name: Build + run: dotnet build --no-restore + + - name: Start containers + run: docker compose -f "docker-compose.yml" up -d && sleep 20 #allow time for mongo to start up properly + + - name: Debug network + run: docker ps -a && docker logs --since 10m serval_cntr && docker logs --since 10m echo_cntr && docker logs --since 10m machine-engine-cntr && docker logs --since 10m serval-mongo-1 && docker logs --since 10m machine-job-cntr + + - name: Pre-Test + run: sudo mkdir -p /var/lib/serval && sudo chmod 777 /var/lib/serval + + - name: Test + run: dotnet test --no-build --verbosity normal --filter "TestCategory!=slow&TestCategory=E2E" + + - name: Debug network (Post test) + if: ${{ failure() }} + run: docker ps -a && docker logs --since 10m serval_cntr && docker logs --since 10m echo_cntr && docker logs --since 10m machine-engine-cntr && docker logs --since 10m serval-mongo-1 && docker logs --since 10m machine-job-cntr + + - name: Stop containers + if: ${{ success() || failure() }} + run: docker compose down