diff --git a/.github/workflows/dependency-updater.yml b/.github/workflows/dependency-updater.yml index 3a0bf70b6..9cb5a346c 100644 --- a/.github/workflows/dependency-updater.yml +++ b/.github/workflows/dependency-updater.yml @@ -1,14 +1,14 @@ -name: Update Dependencies +name: Update dependencies on: schedule: - # Run every hour - - cron: '0 * * * *' + # Run every 15 minutes + - cron: '*/15 * * * *' workflow_dispatch: # Allow manual triggering jobs: update-dependencies: - name: Update dependencies + name: File update PR runs-on: ubuntu-latest permissions: @@ -18,6 +18,11 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v4 + # Checkout main branch + with: + ref: main + env: + GITHUB_TOKEN: ${{ secrets.POLICYENGINE_BOT_TOKEN }} - name: Install uv uses: astral-sh/setup-uv@v5 @@ -47,15 +52,24 @@ jobs: - name: Create pull request if: steps.update.outputs.changes_detected == 'true' - uses: peter-evans/create-pull-request@v5 - with: - token: ${{ secrets.GITHUB_TOKEN }} - commit-message: Update dependencies - branch: update-dependencies - base: main - delete-branch: true - title: "Update dependencies" - body: | - Automated dependency updates - - This PR was automatically created by the dependency update workflow. \ No newline at end of file + run: | + git config --global user.name "policyengine-auto" + git config --global user.email "policyengine-auto@users.noreply.github.com" + + git checkout -b update-dependencies + git add . + git commit -m "Update dependencies" + git push origin update-dependencies --force + + # Try to create PR, ignore if it already exists + gh pr create \ + --title "Update dependencies" \ + --body "Automated dependency updates + + This PR was automatically created by the dependency update workflow. + + Last updated: $(date)" \ + --base main \ + --head update-dependencies || echo "PR may already exist, continuing..." + env: + GITHUB_TOKEN: ${{ secrets.POLICYENGINE_BOT_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index adbbb7b80..dd4fbd23d 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -18,7 +18,7 @@ env: COMMIT_TAG: ${{ github.sha }} jobs: build: - name: Build + name: Build and test # Any runner supporting Node 20 or newer runs-on: ubuntu-latest environment: beta @@ -47,3 +47,5 @@ jobs: architecture: x64 - name: Build application run: make build + - name: Run tests + run: make test diff --git a/Makefile b/Makefile index dcd0478ea..b0f1d5970 100644 --- a/Makefile +++ b/Makefile @@ -12,6 +12,11 @@ update: $(MAKE) -C $$dir update; \ done +test: + for dir in $(SUBDIRS); do \ + $(MAKE) -C $$dir test; \ + done + dev-api-full: echo "Starting API (full) in dev mode" cd projects/policyengine-api-full && make dev