Tests/workflows #1
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # .github/workflows/api-test.yml | |
| name: API Tests | |
| on: | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| api-tests: | |
| runs-on: ubuntu-latest | |
| env: | |
| BASE_URL: "http://54.73.240.131:5000" # Fava host:port | |
| LEDGER_SLUG: "example-beancount-file" # URL prefix in your paths | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 1 | |
| repository: ahdsab/FavaTesting | |
| token: ${{ secrets.TESTING_GITHUB_TOKEN }} | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| - name: Wait until remote Fava is reachable | |
| run: | | |
| set -e | |
| for i in {1..60}; do | |
| if curl -fsS "$BASE_URL/$LEDGER_SLUG/income_statement/" >/dev/null; then | |
| echo "Remote Fava is up"; exit 0 | |
| fi | |
| echo "Waiting for remote Fava... ($i)"; sleep 2 | |
| done | |
| echo "Fava not reachable"; exit 1 | |
| - name: Run API/UI tests | |
| working-directory: API_Testing | |
| env: | |
| BASE_URL: ${{ env.BASE_URL }} | |
| LEDGER_SLUG: ${{ env.LEDGER_SLUG }} | |
| run: | | |
| pytest -q |