generated from feelpp/feelpp-project
-
Notifications
You must be signed in to change notification settings - Fork 0
141 lines (131 loc) · 3.65 KB
/
ci.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
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
name: CI
on: [push]
jobs:
activate:
runs-on: ubuntu-latest
if: |
github.repository == 'feelpp/feelpp-shapo' &&
!startsWith(github.event.head_commit.message, 'Release ') &&
!contains(github.event.head_commit.message, 'ci skip')
steps:
- run: echo ok go
build_docs:
needs: activate
runs-on: ubuntu-latest
name: Build, Install, Package documentation
if: "!contains(github.event.head_commit.message, 'docs skip')"
steps:
- uses: actions/checkout@v3
- name: Install credentials
run: echo https://$GITHUB_OAUTH:@github.com > $HOME/.git-credentials
env:
GITHUB_OAUTH: ${{ secrets.CR_PAT }}
- name: Build
run: |
npm install
npm run antora
working-directory: docs
- name: Deploy
uses: JamesIves/github-pages-deploy-action@v4.4.1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages # The branch the action should deploy to.
FOLDER: docs/public # The folder the action should deploy.
build_code:
needs: activate
runs-on: self-ubuntu-22.04
name: Build, Install, Package code
if: "!contains(github.event.head_commit.message, 'code skip')"
steps:
- name: Checkout
uses: actions/checkout@v3
with:
lfs: true
recursive: true
-
name: Build
run: |
cmake --preset default
cmake --build --preset default
-
name: Check build
run: |
ctest --preset default
env:
OMPI_ALLOW_RUN_AS_ROOT: 1
OMPI_ALLOW_RUN_AS_ROOT_CONFIRM: 1
-
name: Package
run: |
cmake --build --preset default -t package
- name: Upload
uses: actions/upload-artifact@v2
with:
# Artifact name
name: feelpp-shapo-artifacts
# Directory containing files to upload
path: build/default/assets/shapo-*
check:
needs: build_code
runs-on: ubuntu-20.04
name: Check Build, Install, Run
steps:
- name: Download
uses: actions/download-artifact@v2
with:
# Artifact name
name: feelpp-shapo-artifacts
# Directory containing files to upload
path: build/default/assets/
- name: Display Artifact
run: ls -R
working-directory: build/default/assets
deliver:
runs-on: ubuntu-20.04
needs: check
name: Docker Build, Tag, Push
steps:
- uses: actions/checkout@v3
with:
lfs: true
submodules: 'recursive'
- name: Download
uses: actions/download-artifact@v2
with:
# Artifact name
name: feelpp-shapo-artifacts
path: artifacts/
-
name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: |
ghcr.io/feelpp/feelpp-shapo
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
-
name: Set up QEMU
uses: docker/setup-qemu-action@v2.1.0
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1.3.0
-
name: Login to GitHub Container Registry
uses: docker/login-action@v2.1.0
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.CR_PAT }}
-
name: Build container image
uses: docker/build-push-action@v3
with:
context: artifacts
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
file: ./Dockerfile