-
Notifications
You must be signed in to change notification settings - Fork 18
executable file
·130 lines (117 loc) · 5.26 KB
/
build.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
name: Build-Linux
on:
push:
paths-ignore:
- 'doc/**'
- '**.md'
- '**.rst'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
if: ${{ always() }}
strategy:
matrix:
include:
- build: "Debian Bullseye - g++-10"
DIST: debian-bullseye
COMPILER: gcc10
batsched: off
- build: "Debian Bookworm - g++-12"
DIST: debian-bookworm
COMPILER: gcc12
batsched: off
- build: "Ubuntu Jammy Jellyfish - clang++-14"
DIST: ubuntu-jammy
COMPILER: clang14
batsched: off
- build: "Ubuntu Jammy Jellyfish - g++-11"
DIST: ubuntu-jammy
COMPILER: gcc11
batsched: off
- build: "Ubuntu Jammy Jellyfish - g++-11 - batsched"
DIST: ubuntu-jammy
COMPILER: gcc11-batsched
batsched: on
steps:
- uses: actions/checkout@v2
- name: Configure Docker
run: |
sudo apt-get update
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get update
sudo apt-get install -y docker-ce docker-ce-cli containerd.io
- name: Source Build and Test
env:
DIST: ${{ matrix.DIST }}
COMPILER: ${{ matrix.COMPILER }}
batsched: ${{ matrix.batsched }}
run: |
docker pull wrenchproject/wrench-build:${DIST}-${COMPILER};
docker run -m 4g -d -t --name=wrench wrenchproject/wrench-build:${DIST}-${COMPILER} bash;
docker exec wrench git clone https://github.com/wrench-project/wrench;
# if not the master branch, switch to branch
if [[ "$GITHUB_REF" != "refs/heads/master" ]]; then
BRANCH_NAME=$(echo ${GITHUB_REF} | sed 's/refs\/heads\///g');
docker exec -w /home/wrench/wrench wrench git checkout ${BRANCH_NAME};
fi
docker exec wrench mkdir wrench/build;
# build and test wrench
docker exec -w /home/wrench/wrench/build wrench cmake -DENABLE_BATSCHED=${batsched} -DCMAKE_VERBOSE_MAKEFILE=ON ..;
docker exec -w /home/wrench/wrench/build wrench make all unit_tests examples wrench-daemon;
docker exec -w /home/wrench/wrench/build wrench ./unit_tests;
docker exec -w /home/wrench/wrench/build/examples wrench ./run_all_examples.sh wrench-example-batch-smpi-action;
- name: Documentation Build and Deployment
env:
DIST: ${{ matrix.DIST }}
COMPILER: ${{ matrix.COMPILER }}
batsched: ${{ matrix.batsched }}
TOKEN_GITHUB: ${{ secrets.TOKEN_GITHUB }}
run: |
if [[ "$DIST" == "ubuntu-jammy" && "$COMPILER" == "gcc11" && "$batsched" == "off" ]]; then
docker exec -w /home/wrench/wrench/build wrench cmake -DENABLE_BATSCHED=${batsched} -DCMAKE_VERBOSE_MAKEFILE=ON ..;
docker exec -w /home/wrench/wrench/build wrench make doc;
docker cp wrench:/home/wrench/wrench/docs .;
cp -R ./docs/build $HOME/gh-pages-to-deploy;
echo "Starting to update gh-pages"
#copy data we're interested in to other place
git config --global user.email "[email protected]"
git config --global user.name "GitHub Actions"
#using token clone gh-pages branch
git clone --quiet --branch=gh-pages https://${TOKEN_GITHUB}@github.com/wrench-project/wrench.git gh-pages > /dev/null;
#go into directory and copy data we're interested in to that directory
cd gh-pages;
cp -Rf $HOME/gh-pages-to-deploy/* .;
touch .nojekyll;
#add, commit and push files
git add -f .;
git diff-index --quiet HEAD || git commit -m "GitHub build $GITHUB_RUN_NUMBER";
git push -fq origin gh-pages > /dev/null;
echo "Done updating gh-pages.";
fi
- name: Code Coverage
env:
DIST: ${{ matrix.DIST }}
COMPILER: ${{ matrix.COMPILER }}
batsched: ${{ matrix.batsched }}
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
run: |
if [[ "$DIST" == "ubuntu-jammy" && "$COMPILER" == "gcc11" && "$batsched" == "off" ]]; then
docker exec -w /home/wrench/wrench/build wrench lcov --directory . --capture --output-file coverage.info;
docker exec -w /home/wrench/wrench/build wrench lcov --remove coverage.info '*/test/*' '*/examples/*' '*/include/*' --output-file coverage.info;
docker cp wrench:/home/wrench/wrench/build/coverage.info .;
bash <(curl -s https://codecov.io/bash) -f coverage.info -t ${CODECOV_TOKEN};
fi
- name: Slack Notification
uses: rtCamp/action-slack-notify@v2
env:
SLACK_CHANNEL: github
SLACK_ICON: https://github.com/wrench-project.png?size=48
SLACK_USERNAME: wrench-builds
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
MSG_MINIMAL: ref,actions url, commit
SLACK_TITLE: Build ${{ matrix.build }}
SLACK_FOOTER: ''