Skip to content

Commit

Permalink
ci(snapshot): ensure snapshot runs in CI
Browse files Browse the repository at this point in the history
force make targets to run even when uptodate because git doesn't record
modified time
  • Loading branch information
tekumara committed Mar 11, 2024
1 parent dd3af41 commit e6b68e6
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ on:
push:
branches: [main]
pull_request_target:
workflow_dispatch:

jobs:
build:
ci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -15,5 +16,5 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: make test
run: make test
- name: Test
run: make -B test
14 changes: 10 additions & 4 deletions .github/workflows/snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ on:

permissions:
contents: write
actions: write

jobs:
build:
snapshot:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -22,11 +23,16 @@ jobs:
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
- name: make snapshot
run: make snapshot
- name: Snapshot
run: make -B snapshot
- name: Commit and push any changes
env:
GH_TOKEN: ${{ github.token }}
run: |
git add .
if git commit -m "chore: make snapshot"; then
if git commit -m "chore: update snapshot"; then
git push
# git push won't trigger workflows so we manually do it
# see https://github.com/orgs/community/discussions/25702#discussioncomment-8650283
gh workflow run ci.yml
fi
Empty file removed snapshot/my-repo
Empty file.
2 changes: 1 addition & 1 deletion {{cookiecutter.repo_name}}/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[project]
name = "{{cookiecutter.project_name}}"
description = "{{cookiecutter.description}}"
version = "0.0.1"
version = "0.0.0"
readme = "README.md"
requires-python = ">=3.11"
dependencies = []
Expand Down

0 comments on commit e6b68e6

Please sign in to comment.