Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ jobs:
python-version: ${{ matrix.python.version }}
- name: Install dependencies
run: pip3 install tox pytest-github-actions-annotate-failures
- name: Setup dummy config
run: tests/ci_tools/setup-dummy-config.sh
- name: Run tests
env:
TOXENV: ${{ matrix.python.toxenv }}
Expand Down
29 changes: 29 additions & 0 deletions tests/ci_tools/setup-dummy-config.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash

set -u

if [[ -z "${CI:-}" || -z "${GITHUB_ACTIONS:-}" ]]; then
echo "ERROR: Not running in the GitHub CI."
exit 2
fi

CONFIG_FILE=~/.python-gitlab.cfg
if [[ -e "${CONFIG_FILE}" ]]; then
echo "ERROR: Config file already exists: ${CONFIG_FILE}"
echo "Saved you from destroying your config"
exit 2
fi

cat <<EOF >"${CONFIG_FILE}"
[global]
default = gitlab
ssl_verify = true
timeout = 5
api_version = 4

[gitlab]
url = https://gitlab.com/
private_token = not-a-valid-token
EOF

echo "Setup config at: ${CONFIG_FILE}"