Merge pull request #11 from fuhrmanator/9-Field-should-be-renamed-to-… #35
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Name of the project in the GitHub action panel | |
name: Run-Tests-and-Generate-Model-Diagram | |
# Execute the CI on push on the master branch | |
on: | |
push: | |
branches: | |
- master | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
# List of images at https://github.com/hpi-swa/smalltalkCI#images | |
# Use Moose 10 that includes our visualization tool | |
smalltalk: [ Moose64-10] | |
name: ${{ matrix.smalltalk }} | |
steps: | |
# checkout the project | |
- uses: actions/checkout@v3 | |
# Prepare the CI - download the correct VM :-) | |
- uses: hpi-swa/setup-smalltalkCI@v1 | |
with: | |
smalltalk-image: ${{ matrix.smalltalk }} | |
# Use the CI - always better to run test | |
- run: smalltalkci -s ${{ matrix.smalltalk }} | |
shell: bash | |
timeout-minutes: 15 | |
- name: Build meta-model planuml image | |
run: | | |
$SMALLTALK_CI_VM $SMALLTALK_CI_IMAGE eval "'FamixTypeScript.puml' asFileReference writeStreamDo: [ :stream | stream nextPutAll: (FamixMMUMLDocumentor new withModel: FamixTypeScriptModel andColor: Color lightBlue ; beWithStub; generatePlantUMLModel)]" | |
- name: Generate SVG Diagrams | |
uses: cloudbees/plantuml-github-action@master | |
with: | |
args: -v -tsvg FamixTypeScript.puml | |
- name: Move artifact | |
run: | | |
mkdir doc-uml | |
mv *.svg doc-uml | |
- name: Init new repo in doc-uml folder and commit generated files | |
run: | | |
cd doc-uml/ | |
git init | |
git add -A | |
git config --local user.email "action@github.com" | |
git config --local user.name "GitHub Action" | |
git commit -m 'update doc' | |
# Careful, this can kill your project | |
- name: Force push to destination branch | |
uses: ad-m/github-push-action@master | |
with: | |
# Token for the repo. Can be passed in using $\{{ secrets.GITHUB_TOKEN }} | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
force: true | |
# Destination branch to push changes | |
branch: v1/doc | |
# We have to push from the folder where files were generated. | |
# Same were the new repo was initialized in the previous step | |
directory: ./doc-uml | |