From 64c9126f992b2c656a1f4011b8171903f58b7b22 Mon Sep 17 00:00:00 2001 From: Yaroslav Lobankov Date: Sat, 2 Mar 2024 00:39:24 +0400 Subject: [PATCH] ci: add workflow to test app can be run --- .github/workflows/test.yml | 36 ++++++++++++++++++++++++++++++++++++ CHANGELOG.md | 1 + 2 files changed, 37 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..a86761e --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,36 @@ +name: Run app test + +on: + push: + branches-ignore: + - 'master' + workflow_dispatch: + +jobs: + test: + runs-on: ubuntu-latest + steps: + - name: Checkout repo + uses: actions/checkout@v4 + + - name: Build docker image + run: docker build --tag rws --no-cache . + + - name: Run app in docker container + run: | + echo "CONTAINER_ID=$(docker run \ + --env RWS_CFG=/app/config.default \ + --env RWS_CREDENTIALS='{"user": "password"}' \ + --env S3_ACCESS_KEY=foo \ + --env S3_SECRET_KEY=bar \ + --env S3_REGION=foobar \ + --env S3_URL=http://127.0.0.1:9000 \ + --env S3_BUCKET=barfoo \ + --publish 5000:5000 \ + --detach rws)" >> $GITHUB_ENV + + - name: Check app is running + run: | + sleep 10 # give the app enough time to start + docker logs ${CONTAINER_ID} 2>&1 | tee log.txt + grep 'Press CTRL+C to quit' log.txt diff --git a/CHANGELOG.md b/CHANGELOG.md index a74c753..9fa5445 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Added sending notification to VK Teams on deployment failure. - Added deployment to rws-dev on push to the `master` branch. +- Added workflow to test app can be run. ### Changed