Skip to content

Commit

Permalink
Migrate admin-tests to GitHub Actions
Browse files Browse the repository at this point in the history
This is pretty straightforward, we just need to swap the CircleCI
environment variable for one supported by GitHub Actions.
  • Loading branch information
legoktm committed Aug 13, 2024
1 parent e76017f commit 81b0c94
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,11 @@ jobs:
cd journalist_gui
source .venv/bin/activate
QT_QPA_PLATFORM=offscreen python3 test_gui.py -v
admin-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run tests
run: |
make -C admin test
13 changes: 10 additions & 3 deletions admin/bin/dev-shell
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ set -euo pipefail
TOPLEVEL=$(git rev-parse --show-toplevel)
source "${BASH_SOURCE%/*}/../../devops/scripts/ticker"

DOCKER_RUN_ARGUMENTS="${DOCKER_RUN_ARGUMENTS:-}"

# Pass -it if we're a tty
if test -t 0; then
DOCKER_RUN_ARGUMENTS="${DOCKER_RUN_ARGUMENTS} -it"
fi

function docker_image() {
local out
out="$(mktemp)"
Expand All @@ -26,16 +33,16 @@ function docker_image() {
}

function docker_run() {
if [ -z "${CIRCLECI-}" ]
if [ -z "${CI-}" ]
then
docker run \
--rm \
--user "${USER:-root}" \
--volume "${TOPLEVEL}:/sd-root:Z" \
--workdir "/sd-root/admin" \
-ti ${DOCKER_RUN_ARGUMENTS:-} securedrop-admin "$@"
${DOCKER_RUN_ARGUMENTS} securedrop-admin "$@"
else
docker run --rm -ti ${DOCKER_RUN_ARGUMENTS:-} securedrop-admin "$@"
docker run --rm ${DOCKER_RUN_ARGUMENTS} securedrop-admin "$@"
fi

}
Expand Down

0 comments on commit 81b0c94

Please sign in to comment.