Skip to content

Commit 15009b1

Browse files
committed
Use central workflow files
1 parent a8218c8 commit 15009b1

3 files changed

Lines changed: 13 additions & 202 deletions

File tree

.github/workflows/artdaq-develop-cpp-ci.yml

Lines changed: 2 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -20,70 +20,5 @@ on:
2020

2121
jobs:
2222
build_against_dev_release:
23-
name: build_against_dev
24-
# The type of runner that the job will run on
25-
runs-on: ubuntu-latest
26-
27-
# Steps represent a sequence of tasks that will be executed as part of the job
28-
steps:
29-
- uses: cvmfs-contrib/github-action-cvmfs@main
30-
31-
- name: change dir permission
32-
run: |
33-
sudo chmod -R go+rwx /var/lib/cvmfs
34-
35-
- name: Cache cvmfs cache
36-
id: cvmfs_cache
37-
uses: actions/cache@main
38-
with:
39-
path: /var/lib/cvmfs/shared
40-
key: cachecvmfs
41-
42-
- name: restore dir permission
43-
run: |
44-
sudo chown -R cvmfs.cvmfs /var/lib/cvmfs
45-
sudo chmod -R go-rwx /var/lib/cvmfs
46-
47-
- name: Checkout pkg
48-
uses: actions/checkout@main
49-
with:
50-
repository: ${{ github.repository }}
51-
path: scratch/${{ github.repository }}
52-
53-
- name: run build in docker container with cvmfs bind mount
54-
run: |
55-
56-
cd $GITHUB_WORKSPACE/scratch
57-
cat << EOT > build_pkg.sh
58-
#!/bin/bash
59-
60-
cd /opt/otsdaq
61-
source /opt/otsdaq/products/setup
62-
source /opt/otsdaq/setup_ots.sh || exit 1
63-
mrb updateSource
64-
65-
export REPO=$(echo '${{ github.repository }}' | awk -F '/' '{print $2}')
66-
cp -pr /scratch/art-daq/$REPO srcs
67-
68-
echo "Starting build"
69-
mrb b 2>&1 | tee /scratch/art-daq/build.log
70-
71-
exit $?
72-
EOT
73-
chmod +x build_pkg.sh
74-
75-
docker run --rm -v /cvmfs:/cvmfs:shared -v $GITHUB_WORKSPACE/scratch:/scratch eflumerf/artdaq-suite:latest /scratch/build_pkg.sh
76-
77-
- name: Check build log for success
78-
run: |
79-
grep "INFO: stage build SUCCESS" ${{ github.workspace }}/scratch/art-daq/build.log
80-
81-
- name: upload build log file
82-
uses: actions/upload-artifact@main
83-
with:
84-
name: build_log
85-
path: ${{ github.workspace }}/scratch/art-daq/build.log
86-
87-
- name: change dir permission again
88-
run: |
89-
sudo chmod -R go+rwx /var/lib/cvmfs
23+
name: Build against develop
24+
uses: art-daq/.github/.github/workflows/artdaq-develop-cpp-ci.yml@stable

.github/workflows/build-single-pkg.yml

Lines changed: 1 addition & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -15,74 +15,4 @@ jobs:
1515

1616
build_single_pkg:
1717
name: build single pkg
18-
runs-on: ubuntu-latest
19-
20-
steps:
21-
- uses: cvmfs-contrib/github-action-cvmfs@main
22-
23-
- name: change dir permission
24-
run: |
25-
sudo chmod -R go+rwx /var/lib/cvmfs
26-
27-
- name: Cache cvmfs cache
28-
id: cvmfs_cache
29-
uses: actions/cache@main
30-
with:
31-
path: /var/lib/cvmfs/shared
32-
key: cachecvmfs
33-
34-
- name: restore dir permission
35-
run: |
36-
sudo chown -R cvmfs.cvmfs /var/lib/cvmfs
37-
sudo chmod -R go-rwx /var/lib/cvmfs
38-
39-
- name: Checkout pkg
40-
uses: actions/checkout@main
41-
with:
42-
repository: ${{ github.repository }}
43-
path: scratch/${{ github.repository }}
44-
45-
- name: run build in docker container with cvmfs bind mount
46-
run: |
47-
48-
cd $GITHUB_WORKSPACE/scratch
49-
cat << EOT > build_pkg.sh
50-
#!/bin/bash
51-
52-
cd /scratch/art-daq
53-
source /cvmfs/fermilab.opensciencegrid.org/products/artdaq/setup
54-
55-
export REPO=$(echo '${{ github.repository }}' | awk -F '/' '{print $2}')
56-
export buildname="build_\${REPO}"
57-
58-
mkdir \$buildname
59-
cd \$buildname
60-
61-
echo "Logging to /scratch/\$buildname.log"
62-
echo "Calling source ../\$REPO/ups/setup_for_development || true"
63-
source ../\$REPO/ups/setup_for_development || exit 1
64-
65-
echo "Active UPS products:"
66-
ups active || true
67-
68-
echo "Calling buildtool 2>&1 | tee /scratch/\$buildname.log"
69-
CETPKG_J=4 buildtool 2>&1 | tee /scratch/\$buildname.log
70-
exit $?
71-
EOT
72-
chmod +x build_pkg.sh
73-
74-
docker run --rm -v /cvmfs:/cvmfs:shared -v $GITHUB_WORKSPACE/scratch:/scratch eflumerf/sl7-minimal:latest /scratch/build_pkg.sh
75-
76-
- name: Check build log for success
77-
run: |
78-
grep "INFO: stage build SUCCESS" ${{ github.workspace }}/scratch/build_*.log
79-
80-
- name: upload build log file
81-
uses: actions/upload-artifact@main
82-
with:
83-
name: build_log
84-
path: ${{ github.workspace }}/scratch/build_*.log
85-
86-
- name: change dir permission again
87-
run: |
88-
sudo chmod -R go+rwx /var/lib/cvmfs
18+
uses: art-daq/.github/.github/workflows/artdaq-build-single-pkg.yml@stable
Lines changed: 10 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,18 @@
11
name: Test Single Pkg Workflow
22

33
on:
4+
push:
5+
branches:
6+
- develop
7+
paths-ignore:
8+
- 'docs/**'
9+
- '.github/**'
10+
pull_request:
11+
branches: [ develop ]
412
workflow_dispatch:
5-
inputs:
6-
build-type:
7-
description: 'build type, d or p'
8-
default: 'd'
9-
quals:
10-
description: 'qualifiers'
11-
default: 's128:e20'
1213

1314
jobs:
1415

1516
build_single_pkg:
16-
name: build single pkg
17-
runs-on: ubuntu-latest
18-
19-
steps:
20-
- uses: cvmfs-contrib/github-action-cvmfs@main
21-
22-
- name: change dir permission
23-
run: |
24-
sudo chmod -R go+rwx /var/lib/cvmfs
25-
26-
- name: Cache cvmfs cache
27-
id: cvmfs_cache
28-
uses: actions/cache@main
29-
with:
30-
path: /var/lib/cvmfs/shared
31-
key: cachecvmfs
32-
33-
- name: restore dir permission
34-
run: |
35-
sudo chown -R cvmfs.cvmfs /var/lib/cvmfs
36-
sudo chmod -R go-rwx /var/lib/cvmfs
37-
38-
- name: Checkout pkg
39-
uses: actions/checkout@main
40-
with:
41-
repository: ${{ github.repository }}
42-
path: scratch/${{ github.repository }}
43-
44-
- name: start docker container with bind mount cvmfs
45-
run: |
46-
47-
export REPO=$(echo '${{ github.repository }}' | awk -F '/' '{print $2}')
48-
cd $GITHUB_WORKSPACE/scratch
49-
cat << EOT > build_pkg.sh
50-
#!/bin/bash
51-
52-
cd /scratch/art-daq
53-
source /cvmfs/fermilab.opensciencegrid.org/products/artdaq/setup || true
54-
55-
mkdir build_$REPO
56-
cd build_$REPO
57-
source ../$REPO/ups/setup_for_development || true
58-
buildtool -t 2>&1 | tee build.log
59-
EOT
60-
chmod +x build_pkg.sh
61-
62-
docker run --rm -v /cvmfs:/cvmfs:shared -v $GITHUB_WORKSPACE/scratch:/scratch eflumerf/sl7-minimal:latest /scratch/build_pkg.sh
63-
64-
- name: upload build log file
65-
uses: actions/upload-artifact@main
66-
with:
67-
name: build_log_${{ matrix.os_name }}
68-
path: ${{ github.workspace }}/scratch/build_*/build.log
69-
70-
- name: change dir permission again
71-
run: |
72-
sudo chmod -R go+rwx /var/lib/cvmfs
17+
name: test single pkg
18+
uses: art-daq/.github/.github/workflows/artdaq-test-single-pkg.yml@stable

0 commit comments

Comments
 (0)