Skip to content

Commit

Permalink
Merge pull request #7217 from freedomofpress/gha-admin
Browse files Browse the repository at this point in the history
Migrate admin-tests to GitHub Actions
  • Loading branch information
cfm committed Aug 14, 2024
2 parents 5f165e0 + c5171b8 commit ae36146
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 23 deletions.
20 changes: 0 additions & 20 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -230,18 +230,6 @@ jobs:
- store_artifacts:
path: ~/project/test-results

admin-tests:
docker:
- image: debian:bullseye
steps:
- run: apt update && apt-get install -y make jq docker.io
- checkout
- setup_remote_docker
- run:
name: Run tests
command: |
cd admin; make test
static-analysis-and-no-known-cves:
machine:
image: ubuntu-2004:current
Expand Down Expand Up @@ -367,14 +355,6 @@ workflows:
context:
- circleci-slack
<<: *slack-fail-post-step
- admin-tests:
filters:
branches:
ignore:
- /update-builder-.*/
context:
- circleci-slack
<<: *slack-fail-post-step
- static-analysis-and-no-known-cves:
requires:
- lint
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,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 ae36146

Please sign in to comment.