-
Notifications
You must be signed in to change notification settings - Fork 6
86 lines (85 loc) · 3.52 KB
/
continuous-integration-workflow.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
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
schedule:
- cron: '0 5 * * FRI'
jobs:
CI:
strategy:
matrix:
config:
- {dockerfile: 'fedora', tag: 'latest'}
- {dockerfile: 'fedora', tag: 'rawhide', build_args: 'TAG=rawhide', continue-on-error: 'true'}
- {dockerfile: 'ubuntu', tag: 'latest'}
- {dockerfile: 'ubuntu', tag: 'rolling', build_args: 'TAG=rolling'}
- {dockerfile: 'ubuntu', tag: 'devel', build_args: 'TAG=devel', continue-on-error: 'true'}
- {dockerfile: 'ubuntu', tag: 'intel', build_args: 'TAG=22.04,INTEL=yes', cmake_args: '-DCMAKE_CXX_COMPILER=icpx -DCMAKE_CXX_FLAGS=-fp-model=precise', continue-on-error: 'true'}
- {dockerfile: 'opensuse', tag: 'latest'}
- {dockerfile: 'fedora', tag: 'intel', build_args: 'TAG=37,INTEL=yes', cmake_args: '-DCMAKE_CXX_COMPILER=icpc', continue-on-error: 'true'}
continue-on-error: ${{ matrix.config.continue-on-error == 'true' }}
env:
docker-tag: ghcr.io/kokkos/ci-containers/${{ matrix.config.dockerfile }}:${{ matrix.config.tag }}
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
if: github.repository_owner == 'kokkos' && ( github.event_name == 'push' || github.event_name == 'schedule' )
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Convert build_args
id: build_args
run: |
echo "args<<EOF" >> $GITHUB_OUTPUT
echo ${{ matrix.config.build_args }} | sed 's/,/\n/g' >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Free Disk space
shell: bash
run: |
sudo rm -rf /usr/local/lib/android
sudo rm -rf /usr/share/dotnet
- name: Build new image and Load it into Docker for testing
uses: docker/build-push-action@v5
with:
tags: ${{ env.docker-tag }}
file: ${{ matrix.config.dockerfile }}
build-args: ${{ steps.build_args.outputs.args }}
pull: true
push: false
load: true
- name: Checkout kokkos
uses: actions/checkout@v4
with:
repository: kokkos/kokkos
ref: develop
path: kokkos
- name: Build and Test Kokkos using updated image
run: |
docker run -t --rm -v ${{ github.workspace }}/kokkos:/kokkos -w /kokkos ${{ env.docker-tag }} \
sh -c \
"cmake -B builddir \
${{ matrix.config.cmake_args }} \
-DKokkos_ENABLE_HWLOC=ON \
-DKokkos_ENABLE_BENCHMARKS=ON \
-DKokkos_ENABLE_EXAMPLES=ON \
-DKokkos_ENABLE_TESTS=ON \
-DKokkos_ENABLE_SERIAL=ON \
-DKokkos_ENABLE_OPENMP=ON && \
cmake --build builddir --parallel 2 && \
ctest --test-dir builddir --output-on-failure"
- name: Push the image into GitHub Container Registry
uses: docker/build-push-action@v5
if: ${{ github.repository_owner == 'kokkos' && ( github.event_name == 'push' || github.event_name == 'schedule' ) }}
with:
tags: ${{ env.docker-tag }}
file: ${{ matrix.config.dockerfile }}
build-args: ${{ steps.build_args.outputs.args }}
push: true