-
Notifications
You must be signed in to change notification settings - Fork 4
93 lines (78 loc) · 2.71 KB
/
build-and-test.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
name: Build and test
on:
push:
branches: [ "main" , "master" ]
pull_request:
branches: [ "main" , "master" ]
workflow_dispatch:
env:
CMAKE_BUILD_TYPE: Release
jobs:
cmake-build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
container:
# relies on repository name being all lower case
image: ghcr.io/${{ github.repository }}
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
timeout-minutes: 5
steps:
- uses: actions/checkout@v3
- name: Check existence of build configuration file
id: check_configuration
uses: andstor/file-existence-action@v1
with:
files: "CMakeLists.txt"
- name: ccache
uses: hendrikmuhs/[email protected]
- name: Configure CMake
if: steps.check_configuration.outputs.files_exists == 'true'
run: |
git config --global --add safe.directory /__w/sjef/sjef
cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.CMAKE_BUILD_TYPE}} -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache --log-level=DEBUG
- name: Build
if: steps.check_configuration.outputs.files_exists == 'true'
run: cmake --build ${{github.workspace}}/build --config ${{env.CMAKE_BUILD_TYPE}}
- name: Test
if: steps.check_configuration.outputs.files_exists == 'true'
run: |
service ssh restart
service ssh status
ssh localhost hostname || ssh -v localhost hostname
cd ${{github.workspace}}/build && ctest -C ${{env.CMAKE_BUILD_TYPE}} || ctest -C ${{env.CMAKE_BUILD_TYPE}} -V --rerun-failed --output-on-failure
- name: Build doxygen
run: cmake --build ${{github.workspace}}/build --target sjef-doc
python:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
container:
# relies on repository name being all lower case
image: ghcr.io/${{ github.repository }}
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
timeout-minutes: 5
steps:
- uses: actions/checkout@v3
- name: Check existence of build configuration file
id: check_configuration
uses: andstor/file-existence-action@v1
with:
files: "pysjef/build.sh"
- name: build and test
run: |
cd pysjef
. /opt/conda/etc/profile.d/conda.sh
mkdir -p /var/run/sshd
/usr/sbin/sshd
ssh 127.0.0.1 pwd
conda create -c conda-forge -n pysjef -y --file requirements.txt
conda activate pysjef
bash ./build.sh
pytest