-
Notifications
You must be signed in to change notification settings - Fork 10
145 lines (128 loc) · 5.39 KB
/
CI-CD.yml
File metadata and controls
145 lines (128 loc) · 5.39 KB
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
name: Setup Fortran Conda CI/CD
on:
push:
branches: [main, dev]
paths-ignore: ['README.md','CHANGELOG.md','VERSION','LICENSE']
pull_request:
branches: [main]
paths-ignore: ['README.md','CHANGELOG.md','VERSION','LICENSE']
workflow_dispatch:
permissions:
contents: write
pull-requests: write
jobs:
test_fpm:
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') }}
name: ${{ matrix.os }}_${{ matrix.compiler }}_fpm
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- {os: ubuntu-latest, compiler: gfortran }
- {os: ubuntu-latest, compiler: ifx }
- {os: ubuntu-latest, compiler: flang-new}
- {os: ubuntu-latest, compiler: nvfortran}
- {os: windows-latest, compiler: gfortran }
- {os: windows-latest, compiler: ifx, fpm-version: "0.12.0"}
- {os: macos-latest, compiler: gfortran }
steps:
- name: Setup Fortran
uses: gha3mi/setup-fortran-conda@latest
with:
compiler: ${{ matrix.compiler }}
fpm-version: ${{ matrix.fpm-version }}
- name: fpm test (debug)
if: always()
run: fpm @${{ matrix.os }}_${{ matrix.compiler }}_debug --verbose
- name: fpm test (release)
if: always()
run: fpm @${{ matrix.os }}_${{ matrix.compiler }}_release --verbose
test_cmake:
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') }}
name: ${{ matrix.os }}_${{ matrix.compiler }}_cmake
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- {os: ubuntu-latest, compiler: gfortran }
- {os: ubuntu-latest, compiler: ifx }
- {os: ubuntu-latest, compiler: flang-new}
- {os: ubuntu-latest, compiler: nvfortran}
- {os: windows-latest, compiler: gfortran }
- {os: windows-latest, compiler: ifx }
- {os: macos-latest, compiler: gfortran }
steps:
- name: Setup Fortran
uses: gha3mi/setup-fortran-conda@latest
with:
compiler: ${{ matrix.compiler }}
- name: cmake test (debug)
if: always()
run: |
cmake -S . -B build/cmake/debug -DCMAKE_BUILD_TYPE=Debug -G Ninja -DFORCAD_BUILD_TESTS=ON -DCMAKE_Fortran_FLAGS="-DFOR_DEBUG"
cmake --build build/cmake/debug --config Debug --verbose
ctest --test-dir build/cmake/debug --output-on-failure -VV
- name: cmake test (release)
if: always()
run: |
cmake -S . -B build/cmake/release -DCMAKE_BUILD_TYPE=Release -G Ninja -DFORCAD_BUILD_TESTS=ON -DCMAKE_Fortran_FLAGS="-DFOR_DEBUG"
cmake --build build/cmake/release --config Release --verbose
ctest --test-dir build/cmake/release --output-on-failure -VV
- name: cmake install (static)
if: always()
run: |
cmake -S . -B build/cmake/static -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=. -G Ninja -DCMAKE_Fortran_FLAGS="-DFOR_DEBUG"
cmake --build build/cmake/static --config Release
cmake --install build/cmake/static --config Release --verbose
- name: cmake uninstall
if: always()
run: cmake --build build/cmake/static --target uninstall
- name: cmake install (shared)
if: always()
run: |
cmake -S . -B build/cmake/shared -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX=. -G Ninja -DCMAKE_Fortran_FLAGS="-DFOR_DEBUG"
cmake --build build/cmake/shared --config Release
cmake --install build/cmake/shared --config Release --verbose
- name: cmake uninstall
if: always()
run: cmake --build build/cmake/shared --target uninstall
doc_ford:
if: ${{ (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule') && !contains(github.event.head_commit.message, '[skip ci]') }}
name: Generate FORD Documentation
runs-on: ubuntu-latest
steps:
- name: Setup and Generate FORD Documentation
uses: gha3mi/setup-fortran-conda@latest
with:
compiler: gfortran
generate-doc-ford: true
ford-working-directory: .
ford-config: README.md
ford-output-directory: doc
ford-branch: gh-pages
ford-target-folder: .
update_readme_table:
if: ${{ always() && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule') && github.ref == 'refs/heads/main' && !contains(github.event.head_commit.message, '[skip ci]') }}
name: Update README.md status table
needs: [test_fpm, test_cmake]
runs-on: ubuntu-latest
steps:
- name: Update README status
uses: gha3mi/setup-fortran-conda@latest
with:
update-readme-table: true
update-readme-token: ${{ secrets.GH_PAT }} # Update with your GitHub personal access token
update-readme-user-name: "Seyed Ali Ghasemi" # Update with your name
update-readme-user-email: "info@gha3mi.com" # Update with your email
linter_fortitude:
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') }}
name: Run Fortitude Linter
runs-on: ubuntu-latest
steps:
- name: Run Fortitude Linter
uses: gha3mi/setup-fortran-conda@latest
with:
fortitude-check: true
fortitude-settings: "--output-format github"