Skip to content

Commit

Permalink
add cloned PR process to 24.04 base
Browse files Browse the repository at this point in the history
  • Loading branch information
zmraul committed Dec 4, 2024
1 parent e52d005 commit b970ed8
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 3 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/clone-pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Clone PR to test 24.04 base

on:
pull_request:
types:
- opened
- synchronize

jobs:
clone-pr:
runs-on: ubuntu-latest

steps:
- name: Checkout PR code
uses: actions/checkout@v3

Check failure on line 15 in .github/workflows/clone-pr.yaml

View workflow job for this annotation

GitHub Actions / Lint / Lint .github/workflows/

the runner of "actions/checkout@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue
with:
ref: ${{ github.event.pull_request.head.ref }}

- name: Install tox
run: |
pipx install tox
- name: Run switch to 24.04
run: |
tox run -e switch-24.04
- name: Create and push to a new branch
run: |
NEW_BRANCH="24.04-cloned-${{ github.event.pull_request.number }}"
git checkout -b $NEW_BRANCH
git add .
git commit -m "switch to 24.04"
git push origin $NEW_BRANCH
6 changes: 3 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ commands_pre =
commands =
poetry run pytest -v --tb native --log-cli-level=INFO -s --ignore={[vars]tests_path}/unit/ {posargs}

[testenv:pack-24.04]
description = Patch charmcraft.yaml with necessary changes for a 24.04 build, pack and restore
[testenv:switch-24.04]
description = Patch charmcraft.yaml with necessary changes for a 24.04 build
allowlist_externals =
sh
commands =
sh -c "patch {toxinidir}/charmcraft.yaml < {toxinidir}/charmcraft-24.04.patch && charmcraft pack --project-dir={toxinidir}; git -C {toxinidir} restore charmcraft.yaml"
sh -c "patch {toxinidir}/charmcraft.yaml < {toxinidir}/charmcraft-24.04.patch"

0 comments on commit b970ed8

Please sign in to comment.