Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create ci.yml #6

Merged
merged 1 commit into from
May 31, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 88 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: Hooktest and Release

on:
push:
# Dispatch when pushing to default branch; currently `master`
branches:
- master
# Dispatch on pull requests
pull_request:
jobs:
run_hooktest:
name: Run Hooktest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# Setup Python
- name: Set up Python 3.11
# > 3.11 breaks hooktest
uses: actions/setup-python@v2
with:
python-version: "3.11"
# Setup Java for Hooktest
- name: Set up Java
uses: actions/setup-java@v2
with:
distribution: "zulu"
java-version: "11"
- name: Install Hooktest
run: pip3 install HookTest
- name: Run Hooktest
run: hooktest ./ --console --scheme epidoc --workers 3 --verbose 10 --manifest --countword --allowfailure
# Include manifest.txt as a job artifact so we can re-use it when creating the release.
- name: Export manifest.txt
id: export_manifest
uses: actions/upload-artifact@v3
with:
name: manifest-txt
path: manifest.txt
create_release:
name: Create release
# Only create releases on commits to the default branch; currently `master`.
# We are able to use the event.repository.default_branch variable within the job definition,
# but _not_ in workflow:on definition above.
if: success() && github.ref == format('refs/heads/{0}', github.event.repository.default_branch)
runs-on: ubuntu-latest
needs: run_hooktest
env:
MAJOR_VERSION: 0
MINOR_VERSION: 0
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v2
# Setup Python
- name: Set up Python 3.11
# > 3.11 breaks hooktest
uses: actions/setup-python@v2
with:
python-version: "3.11"
# Setup Java for Hooktest
- name: Set up Java
uses: actions/setup-java@v2
with:
distribution: "zulu"
java-version: "11"
- name: Install Hooktest
run: pip3 install HookTest
- name: Restore manifest.txt
id: restore_manifest
uses: actions/download-artifact@v3
with:
name: manifest-txt
- name: Prepare tag
run: |
hooktest-build --travis --txt ./
results=$(cat manifest.txt)
DATE=`date +%Y-%m-%d`
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
export GIT_TAG=$MAJOR_VERSION.$MINOR_VERSION.$GITHUB_RUN_ID
git add -A
git commit -m "Removed failing files" -m "Release $GIT_TAG"
git tag $GIT_TAG -a -m "$DATE" -m "PASSING FILES" -m "$results"
git push -q origin "${GIT_TAG}"
ls -R
- name: Create release
uses: ncipollo/release-action@v1
with:
tag: ${{ env.MAJOR_VERSION }}.${{ env.MINOR_VERSION }}.${{ github.run_id }}
Loading