Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewmogan authored Feb 4, 2025
0 parents commit 38b9327
Show file tree
Hide file tree
Showing 5 changed files with 192 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/auto_approve.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Auto approve

on:
workflow_dispatch:
inputs:
pullRequestNumber:
description: Pull request number to auto-approve
required: false

jobs:
auto-approve:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- uses: hmarr/auto-approve-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
pull-request-number: ${{ github.event.inputs.pullRequestNumber }}
90 changes: 90 additions & 0 deletions .github/workflows/dunedaq-develop-cpp-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
name: build-develop

# Controls when the action will run. Workflow runs when manually triggered using the UI
# or API.
on:
push:
branches:
- develop
- patch/*
- prep-release/*
paths-ignore:
- 'docs/**'
- '.github/**'
pull_request:
branches: [ develop ]
schedule:
- cron: "0 9 * * *"

workflow_dispatch:


jobs:
Build_against_dev_release:
name: build_against_dev_on_${{ matrix.os_name }}
# The type of runner that the job will run on
runs-on: ubuntu-latest
strategy:
matrix:
include:
- image: "ghcr.io/dune-daq/nightly-release-alma9:development_v5"
os_name: "a9"
container:
image: ${{ matrix.image }}
defaults:
run:
shell: bash

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Runs a single command using the runners shell

- name: Checkout daq-release
uses: actions/checkout@v3
with:
repository: DUNE-DAQ/daq-release
path: daq-release

- name: setup dev area
run: |
export REPO=$(echo '${{ github.repository }}' | awk -F '/' '{print $2}')
source /cvmfs/dunedaq.opensciencegrid.org/setup_dunedaq.sh
setup_dbt latest_v5 || true
release_name="last_fddaq"
if [[ -n $( sed -r -n '/- name: '$REPO'$/p' daq-release/configs/nddaq/nddaq-develop/release.yaml ) ]] ; then release_name="last_nddaq"; fi
dbt-create -n $release_name dev-${{ matrix.os_name }}
- name: checkout package for CI
uses: actions/checkout@v3
with:
path: ${{ github.repository }}

- name: setup build env, build the repo against the development release
run: |
export REPO=$(echo '${{ github.repository }}' | awk -F '/' '{print $2}')
cd $GITHUB_WORKSPACE/dev-${{ matrix.os_name }}
source env.sh || true
test $REPO == "dbe" && spack load dbe || true
spack unload $REPO || true
cp -pr $GITHUB_WORKSPACE/DUNE-DAQ/$REPO $GITHUB_WORKSPACE/dev-${{ matrix.os_name }}/sourcecode
dbt-build # --unittest # --lint
- name: upload build log file
uses: actions/upload-artifact@v3
with:
name: build_log_${{ matrix.os_name }}
path: ${{ github.workspace }}/dev-${{ matrix.os_name }}/log/build*.log

# - name: upload linter output file
# uses: actions/upload-artifact@v3
# with:
# name: linting_log_${{ matrix.os_name }}
# path: ${{ github.workspace }}/dev-${{ matrix.os_name }}/log/linting*

# - name: upload unittest output file
# uses: actions/upload-artifact@v3
# with:
# name: unit_tests_log_${{ matrix.os_name }}
# path: ${{ github.workspace }}/dev-${{ matrix.os_name }}/log/unit_tests*
40 changes: 40 additions & 0 deletions .github/workflows/track_new_issues.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Add issue to project
on:
issues:
types:
- opened

jobs:
track_issue:
runs-on: ubuntu-latest
steps:
- name: Get project data
env:
GITHUB_TOKEN: ${{ secrets.BOT_CI_ISSUES }}
ORGANIZATION: DUNE-DAQ
PROJECT_NUMBER: 5
run: |
gh api graphql -f query='
query($org: String!, $number: Int!) {
organization(login: $org){
projectV2(number: $number) {
id
}
}
}' -f org=$ORGANIZATION -F number=$PROJECT_NUMBER > project_data.json
echo 'PROJECT_ID='$(jq '.data.organization.projectV2.id' project_data.json) >> $GITHUB_ENV
- name: Add issue to project
env:
GITHUB_TOKEN: ${{ secrets.BOT_CI_ISSUES }}
ISSUE_ID: ${{ github.event.issue.node_id }}
run: |
item_id="$( gh api graphql -f query='
mutation($project:ID!, $issue:ID!) {
addProjectV2ItemById(input: {projectId: $project, contentId: $issue}) {
item {
id
}
}
}' -f project=$PROJECT_ID -f issue=$ISSUE_ID --jq '.data.addProjectV2ItemById.item.id')"
40 changes: 40 additions & 0 deletions .github/workflows/track_new_prs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Add pull request to project
on:
pull_request:
types:
- opened
jobs:
track_issue:
runs-on: ubuntu-latest
steps:
- name: Get project data
env:
GITHUB_TOKEN: ${{ secrets.BOT_CI_ISSUES }}
ORGANIZATION: DUNE-DAQ
PROJECT_NUMBER: 5
run: |
gh api graphql -f query='
query($org: String!, $number: Int!) {
organization(login: $org){
projectV2(number: $number) {
id
}
}
}' -f org=$ORGANIZATION -F number=$PROJECT_NUMBER > project_data.json
echo 'PROJECT_ID='$(jq '.data.organization.projectV2.id' project_data.json) >> $GITHUB_ENV
- name: Add issue to project
env:
GITHUB_TOKEN: ${{ secrets.BOT_CI_ISSUES }}
run: |
PR_NUMBER=${{ github.event.pull_request.number }}
node_id=`curl -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/${{ github.repository }}/pulls/${PR_NUMBER} | jq '.node_id'`
item_id="$( gh api graphql -f query='
mutation($project:ID!, $issue:ID!) {
addProjectV2ItemById(input: {projectId: $project, contentId: $issue}) {
item {
id
}
}
}' -f project=$PROJECT_ID -f issue=$node_id --jq '.data.addProjectV2ItemById.item.id')"
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Edit Me

Modify this README to describe your repository.

0 comments on commit 38b9327

Please sign in to comment.