forked from Urban-Meteorology-Reading/SUEWS
-
Notifications
You must be signed in to change notification settings - Fork 8
90 lines (71 loc) · 2.56 KB
/
f-prettify.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
name: Fortran_prettify
on:
# File paths to consider in the event. Optional; defaults to all
push:
# branches: # Array of patterns that match refs/heads
# - master # Push events on master branch
# - test-dev
# - 'releases/*' # Push events to branches matching refs/heads/releases/*
# - '!refs/pull/*'
# tags: # Array of patterns that match refs/tags.
# - v1 # Push events to v1 tag
paths: # Push events containing matching files
- 'src/suews/src/*'
- 'supy-driver/*'
- '.github/workflows/f-prettify.yml'
jobs:
fprettify:
runs-on: ubuntu-latest
steps:
# - name: Fix up git URLs
# run: echo -e '[url "https://github.com/"]\n insteadOf = "[email protected]:"' >> ~/.gitconfig
- uses: actions/checkout@v2
with:
token: ${{ secrets.PAT }}
submodules: true
# - name: Setup git user
# env:
# ACCESS_TOKEN: ${{ secrets.PAT }}
# run: |
# if [ -z "$COMMIT_EMAIL" ]
# then
# COMMIT_EMAIL="${GITHUB_ACTOR}@users.noreply.github.com"
# fi
# if [ -z "$COMMIT_NAME" ]
# then
# COMMIT_NAME="${GITHUB_ACTOR}"
# fi
# git config --global credential.helper store && \
# git config --global user.email "${COMMIT_EMAIL}" && \
# git config --global user.name "${COMMIT_NAME}" && \
# REPOSITORY_PATH="https://${ACCESS_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
- name: Setup Python for use with actions
uses: actions/setup-python@v2
with:
python-version: '3.9' # Version range or exact version of a Python version to use, using semvers version range syntax.
architecture: 'x64' # (x64 or x86)
- name: install fprettify
run: |
pip install fprettify -U
make pip
- name: format Fortran code
run: fprettify src/suews/src/*f95 -c .fprettify.yml
# - name: Commit changes
# uses: elstudio/actions-js-build/commit@v3
# env:
# GITHUB_TOKEN: ${{ secrets.PAT }}
# with:
# - name: Git Auto Commit
# uses: stefanzweifel/[email protected]
# with:
# commit_message: "[GH Actions] fprettify source code"
# file_pattern: SUEWS-SourceCode/*f95
# push_options: '--force'
# skip_dirty_check: true
# skip_fetch: true
# commit_options: '--no-verify'
- name: Add & Commit
uses: EndBug/[email protected]
with:
add: 'src/suews/src/*f95'
message: "[GH Actions] fprettify source code"