Skip to content

Tests

Tests #122

Workflow file for this run

name: Tests
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
schedule:
- cron: '0 6 * * *' # 6 AM UTC daily
jobs:
test:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Load 1password secret(s)
uses: 1password/load-secrets-action@v2
with:
export-env: true
env:
OP_SERVICE_ACCOUNT_TOKEN: "${{ secrets.TESTS_SERVICE_ACCOUNT_TOKEN }}"
SPONSORSHIPS_READ_TOKEN: "op://test-secrets/DDEV_READ_ORG_SPONSORSHIPS/credential"
- name: Install test dependencies
run: |
# Install bats
sudo apt-get update
sudo apt-get install -y bats bats-assert bats-file bats-support
# Install required tools
sudo npm install -g strip-json-comments-cli
sudo apt-get install -y jq bc
- name: Fetch github sponsorship data
run: |
set -eu -o pipefail
SPONSORED_ENTITY_NAME=ddev SPONSORED_ENTITY_TYPE=organization scripts/github-sponsorships.sh
SPONSORED_ENTITY_NAME=rfay SPONSORED_ENTITY_TYPE=user scripts/github-sponsorships.sh
- name: Run tests
run: |
cd ${{ github.workspace }}
bats ./tests/test.bats --verbose-run
- name: Upload test artifacts on failure
if: failure()
uses: actions/upload-artifact@v4
with:
name: test-results
path: |
/tmp/bats-*
data/
if-no-files-found: ignore