Skip to content

CI update

CI update #44

Workflow file for this run

# run runall.py on commit and commit result to the repo
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
fetch-commit-message:
runs-on: ubuntu-latest
outputs:
commit_message: ${{ steps.get_commit_message.outputs.message }}
steps:
- uses: actions/checkout@v4
- name: "Fetch commit message"
id: get_commit_message
run: echo "message=$(git log -1 --pretty=%B)" >> $GITHUB_OUTPUT
check-no-ci:
runs-on: ubuntu-latest
needs: fetch-commit-message
outputs:
no_ci: ${{ steps.check_no_ci.outputs.no_ci }}
steps:
- name: "Check for [no_ci] in commit message"
id: check_no_ci
run: |
if echo "${{ needs.fetch-commit-message.outputs.commit_message }}" | grep -iq '\[no_ci\]'; then
echo "no_ci=true" >> $GITHUB_OUTPUT
else
echo "no_ci=false" >> $GITHUB_OUTPUT
fi
spellcheck:
runs-on: ubuntu-latest
needs: check-no-ci
if: needs.check-no-ci.outputs.no_ci == 'false'
steps:
- name: checkout repository
uses: actions/checkout@v4
- name: Install codespell
shell: bash
run: |
sudo apt-get update || true
sudo apt-get install -y codespell
- name: Run Spellchecker
run: codespell
run-main:
runs-on: ubuntu-latest
needs: check-no-ci
if: needs.check-no-ci.outputs.no_ci == 'false'
steps:
- uses: actions/checkout@v4
- name: "Set up Python"
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: "Install dependencies"
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: "Run all"
run: python ./src/runall.py
- name: "Commit results"
run: |
git config --global user.email ""
git config --global user.name "GitHub Actions"
git add .
git commit -m "Github Actions CI" || echo "Nothing to commit"
git push || echo "Nothing to push"