diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..409225a --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,25 @@ +name: Continuous Integration + +on: + push: + branches: + - main + pull_request: + branches: + - main + merge_group: + types: + - checks_requested + +jobs: + test: + name: Run tests + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Build image + run: docker build --target uta-test -t uta-test . + - name: Run tests + run: docker run --rm uta-test python -m unittest diff --git a/Dockerfile b/Dockerfile index ec6d67d..e58df99 100644 --- a/Dockerfile +++ b/Dockerfile @@ -27,5 +27,6 @@ FROM uta as uta-test RUN DEBIAN_FRONTEND=noninteractive apt-get -yq install postgresql COPY tests ./tests RUN pip install -e .[test] -RUN useradd postgres-testing -USER postgres-testing +RUN useradd uta-tester +RUN chown -R uta-tester . +USER uta-tester diff --git a/README.md b/README.md index 8b95314..78da019 100644 --- a/README.md +++ b/README.md @@ -289,8 +289,7 @@ To develop UTA, follow these steps. 4. Testing $ docker build --target uta-test -t uta-test . - $ docker run -it --rm -v $(pwd):/opt/repos/uta uta-test bash - $ python -m unittest + $ docker run -it --rm uta-test python -m unittest ## UTA update procedure