Skip to content

Commit

Permalink
update actions
Browse files Browse the repository at this point in the history
  • Loading branch information
tsmathis committed Sep 18, 2024
1 parent 0032dc0 commit 6c6bd5f
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
fetch-depth: 0

- name: Set up Miniconda
Expand All @@ -39,30 +40,32 @@ jobs:
- name: Install Python dependencies
shell: bash -l {0}
run: |
python${{ matrix.python-version }} -m pip install --upgrade pip pip-tools pre-commit
python${{ matrix.python-version }} -m pip install --upgrade pip pip-tools black
python${{ matrix.python-version }} -m pip install --user `grep numpy ${{ matrix.package }}/requirements/${{ matrix.os }}_py${{ matrix.python-version }}_extras.txt`
python${{ matrix.python-version }} -m pip install --user -r ${{ matrix.package }}/requirements/${{ matrix.os }}_py${{ matrix.python-version }}_extras.txt
env:
CC: gcc-10
CXX: g++-10

- name: generate Enums
- name: Generate enums and check output
id: enums
shell: bash -l {0}
if: matrix.package == 'emmet-core'
run: |
python${{ matrix.python-version }} emmet-core/emmet/core/qchem/calc_types/generate.py
python${{ matrix.python-version }} emmet-core/emmet/core/vasp/calc_types/generate.py
pre-commit run --all-files --show-diff-on-failure
python${{ matrix.python-version }} emmet-core/dev_scripts/generate_enums.py
black emmet-core/emmet/core/*/calc_types/enums.py
echo "count=$(git diff-index HEAD emmet-core/emmet/core/*/calc_types/enums.py | wc -l | xargs)" >> $GITHUB_OUTPUT
echo "files=$(git ls-files --exclude-standard --others emmet-core/emmet/core/*/calc_types/enums.py | wc -l | xargs)" >> $GITHUB_OUTPUT
- name: commit & push enums changes
if: matrix.package == 'emmet-core' && (steps.enums.outputs.count > 0 || steps.enums.outputs.files > 0)
- name: Commit & push enums changes
shell: bash -l {0}
if: matrix.package == 'emmet-core' && (steps.enums.outputs.count > 0 || steps.enums.outputs.files > 0)
run: |
git config user.name github-actions
git config user.email [email protected]
git add emmet-core/emmet/core/*/calc_types/enums.py
git commit --allow-empty -m "update calc type enums"
git push origin ${{ github.ref_name }}
git commit --allow-empty -m "[automated commit] update calc type enums"
git push
- name: Install editable emmet-core if needed
shell: bash -l {0}
Expand Down

0 comments on commit 6c6bd5f

Please sign in to comment.