-
Notifications
You must be signed in to change notification settings - Fork 1
151 lines (136 loc) · 5.32 KB
/
CI-CD.yml
File metadata and controls
151 lines (136 loc) · 5.32 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
146
147
148
149
150
151
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: ubuntu-latest, compiler: lfortran }
- {os: windows-latest, compiler: gfortran }
- {os: windows-latest, compiler: ifx }
- {os: windows-latest, compiler: flang-new}
- {os: windows-latest, compiler: lfortran }
- {os: macos-latest, compiler: gfortran }
- {os: macos-latest, compiler: lfortran }
steps:
- name: Setup Fortran
uses: gha3mi/setup-fortran-conda@latest
with:
platform: ${{ matrix.os }}
compiler: ${{ matrix.compiler }}
- name: fpm test (debug)
run: fpm @${{ matrix.os }}_${{ matrix.compiler }}_debug --verbose
- name: fpm test (release)
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: ubuntu-latest, compiler: lfortran }
- {os: windows-latest, compiler: gfortran }
- {os: windows-latest, compiler: ifx }
- {os: windows-latest, compiler: flang-new}
- {os: windows-latest, compiler: lfortran }
- {os: macos-latest, compiler: gfortran }
- {os: macos-latest, compiler: lfortran }
steps:
- name: Setup Fortran
uses: gha3mi/setup-fortran-conda@latest
with:
platform: ${{ matrix.os }}
compiler: ${{ matrix.compiler }}
- name: cmake test (debug)
run: |
cmake -S . -B build/debug -DCMAKE_BUILD_TYPE=Debug -DCMAKE_Fortran_COMPILER=${{ matrix.compiler }} -G Ninja -DFORTIME_BUILD_TESTS=ON
cmake --build build/debug --config Debug
ctest --test-dir build/debug --output-on-failure
- name: cmake test (release)
run: |
cmake -S . -B build/release -DCMAKE_BUILD_TYPE=Release -DCMAKE_Fortran_COMPILER=${{ matrix.compiler }} -G Ninja -DFORTIME_BUILD_TESTS=ON
cmake --build build/release --config Release
ctest --test-dir build/release --output-on-failure
doc_ford:
if: ${{ github.event_name == 'push' && !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
platform: ubuntu-latest
generate-doc-ford: true
ford-working-directory: .
ford-config: README.md
ford-output-directory: doc
ford-branch: gh-pages
ford-target-folder: .
status_fpm:
if: ${{ always() && github.event_name == 'push' && !contains(github.event.head_commit.message, '[skip ci]') }}
name: Generate STATUS.md
needs: [test_fpm]
runs-on: ubuntu-latest
steps:
- name: Generate summary
uses: gha3mi/setup-fortran-conda@latest
with:
generate-status-fpm: true
status_cmake:
if: ${{ always() && github.event_name == 'push' && !contains(github.event.head_commit.message, '[skip ci]') }}
name: Generate STATUS.md
needs: [test_cmake]
runs-on: ubuntu-latest
steps:
- name: Generate summary
uses: gha3mi/setup-fortran-conda@latest
with:
generate-status-cmake: true
update_readme_table:
if: ${{ always() && github.event_name == 'push' && github.ref == 'refs/heads/main' && !contains(github.event.head_commit.message, '[skip ci]') }}
name: Update README.md status table
needs: [status_fpm, status_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"