From a6b33e394b79833a3d6504396aad8b11c621f5cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Budai?= Date: Wed, 26 Aug 2020 10:34:55 +0200 Subject: [PATCH] ci/koji: use the same container setup as for local testing Services in Github Actions are cool but have some drawbacks: 1) We want to be able to use the container setup locally, therefore there's run-koji-container script which does exactly the same setup as it's defined in Github Actions. We don't want duplicities though. 2) In the near future, we will need more complicated setup - generating certificates before a container is started. This is not possible with the current Github Actions capabilities. This commit removes the container setup from Github Actions and just reuses the run-koji-container script in the GH Actions environment. This way we have only one setup which is also more flexible. --- .github/workflows/tests.yml | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c2d283c3d..2daed1143 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -52,22 +52,6 @@ jobs: koji: name: "้บน Koji test" runs-on: ubuntu-latest - services: - postgres: - image: docker.io/library/postgres:12-alpine - env: - POSTGRES_USER: koji - POSTGRES_PASSWORD: kojipass - POSTGRES_DB: koji - koji: - image: quay.io/osbuild/ghci-koji:v1 - env: - POSTGRES_USER: koji - POSTGRES_PASSWORD: kojipass - POSTGRES_DB: koji - POSTGRES_HOST: postgres - ports: - - 8080:80 steps: - name: Set up Go 1.13 uses: actions/setup-go@v1 @@ -95,7 +79,10 @@ jobs: sudo cp .github/koji.conf /etc/koji.conf - name: Run unit tests - run: go test -v -race -covermode atomic -coverprofile=coverage.txt -tags koji_test ./internal/upload/koji + run: | + sudo internal/upload/koji/run-koji-container.sh start + go test -v -race -covermode atomic -coverprofile=coverage.txt -tags koji_test ./internal/upload/koji + sudo internal/upload/koji/run-koji-container.sh stop - name: Send coverage to codecov.io run: bash <(curl -s https://codecov.io/bash)