From 8cb582f848218ffe2336b8a68f01d5677ef27a00 Mon Sep 17 00:00:00 2001 From: Juan Esteban Arango Ossa Date: Mon, 21 Oct 2024 17:42:42 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=90=20try=20appending=20GH=5FPAT=20to?= =?UTF-8?q?=20repo=20url?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/run-test.yaml | 12 +++--------- tests/test-with-compose.sh | 7 ++++--- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/.github/workflows/run-test.yaml b/.github/workflows/run-test.yaml index e8a24ae..eeb857c 100644 --- a/.github/workflows/run-test.yaml +++ b/.github/workflows/run-test.yaml @@ -10,14 +10,6 @@ jobs: - name: Checkout code uses: actions/checkout@v2 - - name: Configure credential helper to clone private repos - run: | - echo '#!/bin/bash' > ~/.git-credential-helper.sh - echo 'echo username=${{ secrets.GH_USERNAME }}' >> ~/.git-credential-helper.sh - echo 'echo password=${{ secrets.GH_PAT }}' >> ~/.git-credential-helper.sh - chmod +x ~/.git-credential-helper.sh - git config --global credential.helper "/bin/bash ~/.git-credential-helper.sh" - - name: Set up Python uses: actions/setup-python@v2 with: @@ -42,9 +34,11 @@ jobs: - name: Install dependencies run: pip install -r requirements.txt - + - name: Run tests run: bash tests/test-with-compose.sh + env: + GH_PAT: ${{ secrets.GH_PAT }} - name: Upload coverage reports to Codecov with GitHub Action uses: codecov/codecov-action@v4.2.0 diff --git a/tests/test-with-compose.sh b/tests/test-with-compose.sh index 4366ccb..29fe45d 100644 --- a/tests/test-with-compose.sh +++ b/tests/test-with-compose.sh @@ -12,11 +12,12 @@ echo "API directory set to: $API_DIR" echo "CLI directory set to: $CLI_DIR" # get current isabl branch in case this test depends on a particular branch -ISABL_BRANCH=${TRAVIS_PULL_REQUEST_BRANCH:-${TRAVIS_BRANCH:-master}} -echo "ISABL_BRANCH set to $ISABL_BRANCH given travis branch: $TRAVIS_BRANCH $TRAVIS_PULL_REQUEST_BRANCH" +GH_BRANCH=$(echo ${GITHUB_REF#refs/heads/}) +ISABL_BRANCH=${GH_BRANCH:-master} +echo "ISABL_BRANCH set to $ISABL_BRANCH given Github branch: $GH_BRANCH" # clone api from github -rm -rf $API_DIR && git clone https://github.com/papaemmelab/isabl_api.git $API_DIR +rm -rf $API_DIR && git clone https://${GH_PAT}@github.com/papaemmelab/isabl_api.git $API_DIR cd $API_DIR && (git checkout $ISABL_BRANCH || true) && docker-compose build && docker-compose up -d # give some time to API to start and test Isabl CLI