diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index 0dd9ce7..aa22f22 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -20,6 +20,21 @@ jobs: uses: crazy-max/ghaction-docker-buildx@v1 with: buildx-version: latest + - name: Prepare .env for xoatuh2 integration tests + shell: bash + env: # Or as an environment variable + XOAUTH2_RELAYHOST_USERNAME: ${{ secrets.XOAUTH2_RELAYHOST_USERNAME }} + XOAUTH2_CLIENT_ID: ${{ XOAUTH2_CLIENT_ID }} + XOAUTH2_SECRET: ${{ XOAUTH2_SECRET }} + XOAUTH2_INITIAL_REFRESH_TOKEN: ${{ XOAUTH2_INITIAL_REFRESH_TOKEN }} + run: + echo "RELAYHOST_USERNAME=${XOAUTH2_RELAYHOST_USERNAME}" > integration-tests/xoauth2/.env + echo "FROM=${XOAUTH2_RELAYHOST_USERNAME}" >> integration-tests/xoauth2/.env + echo "TO=${XOAUTH2_RELAYHOST_USERNAME}" >> integration-tests/xoauth2/.env + echo "XOAUTH2_CLIENT_ID=${XOAUTH2_CLIENT_ID}" >> integration-tests/xoauth2/.env + echo "XOAUTH2_SECRET=${XOAUTH2_SECRET}" >> integration-tests/xoauth2/.env + echo "XOAUTH2_INITIAL_REFRESH_TOKEN=${XOAUTH2_INITIAL_REFRESH_TOKEN}" >> integration-tests/xoauth2/.env + cp integration-tests/xoauth2/.env integration-tests/xoauth2-error/.env - name: Run integration tests run: ./integration-tests.sh - name: Run HELM chart tests @@ -30,4 +45,3 @@ jobs: DOCKER_PASSWORD: '${{ secrets.DOCKER_ACCESS_TOKEN }}' PLATFORMS: "linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/ppc64le" run: ./build.sh -t boky/postfix --push - diff --git a/integration-tests.sh b/integration-tests.sh index 872fda2..9e9daf6 100755 --- a/integration-tests.sh +++ b/integration-tests.sh @@ -28,9 +28,7 @@ if [[ $# -gt 0 ]]; then shift done else - # Disable xoauth2 integration tests as they an access and refresh token. And these expire - # after a certain time, so we cannot rely on tests working all the time. - for i in `find -maxdepth 1 -type d | grep -Ev "^./(xoauth2|tester)" | sort`; do + for i in `find -maxdepth 1 -type d | grep -Ev "^./(tester)" | sort`; do i="$(basename "$i")" if [ "$i" == "." ] || [ "$i" == ".." ]; then continue