Skip to content

Commit

Permalink
[patch] Write a workflow that runs tests on the latest conda release (#…
Browse files Browse the repository at this point in the history
…334)

* Run unit tests on the latest release tag

* Sneaky: re-target the pr-target-opened to the hotfix branch

Because it happens on opening, I need the new target to actually be merged to main to test it! Let's sneak that in here, even though it's unrelated
  • Loading branch information
liamhuber authored May 24, 2024
1 parent 3c5b71a commit e2a1d7f
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/pr-target-opened.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ on:

jobs:
pyiron:
uses: pyiron/actions/.github/workflows/pr-target-opened.yml@actions-2.0.7
uses: pyiron/actions/.github/workflows/pr-target-opened.yml@hotfix_binder_button
secrets: inherit
50 changes: 50 additions & 0 deletions .github/workflows/test-latest-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# This tests the latest conda-forge release rather than the local code
# When included in a cron job, it will flag maintainers if the conda installation malfunctions
# (e.g. because of a problem with dependencies)

name: Test Conda Release

on:
workflow_dispatch:
schedule:
- cron: '0 0 * * 1'

jobs:
test-conda-release:
runs-on: ubuntu-latest
steps:
- name: Get latest release tag
id: get-release
uses: actions/github-script@v7
with:
result-encoding: string
script: |
const response = await github.rest.repos.getLatestRelease({
owner: context.repo.owner,
repo: context.repo.repo
});
console.log(response.data.tag_name);
return response.data.tag_name
- name: Checkout release
uses: actions/checkout@v4
with:
ref: ${{ steps.get-release.outputs.result }}
- name: Create env from repo name
shell: bash -l {0}
run: |
echo -e "channels:\n- conda-forge\ndependencies:\n- ${{ github.event.repository.name }}" > ./just_this_package_environment.yml
cat ./just_this_package_environment.yml
echo `pwd`
- uses: pyiron/actions/cached-miniforge@main
with:
python-version: '3.12'
env-files: ./just_this_package_environment.yml
local-code-directory: ''
- uses: pyiron/actions/pyiron-config@main
- uses: pyiron/actions/add-to-python-path@main
with: # This is specific to getting the pympipool tests to work
path-dirs: tests tests/benchmark tests/integration tests/static tests/unit
- name: Test
shell: bash -l {0}
run: |
python -m unittest discover tests/unit

0 comments on commit e2a1d7f

Please sign in to comment.