-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #33 from DUNE/hwallace/feature/workflows
Github Workflows for CI/CD
- Loading branch information
Showing
7 changed files
with
184 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# To get started with Dependabot version updates, you'll need to specify which | ||
# package ecosystems to update and where the package manifests are located. | ||
# Please see the documentation for all configuration options: | ||
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file | ||
|
||
version: 2 | ||
updates: | ||
- package-ecosystem: "github-actions" # Specify that Dependabot should check for GitHub Actions updates | ||
directory: ".github/workflows/" # Location of the GitHub Actions workflow files | ||
schedule: | ||
interval: "weekly" # Check for updates on a weekly basis |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Pull request description: | ||
|
||
|
||
## Changes or fixes: | ||
|
||
|
||
## Examples: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
--- | ||
# Update MaCh3 container image registry with newest updates | ||
name: Image CD | ||
|
||
# The events that trigger the workflow | ||
on: | ||
push: | ||
branches: | ||
- develop | ||
tags: | ||
- 'v*' | ||
|
||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false # KS: Prevents cancellation of remaining jobs if one fails | ||
matrix: | ||
include: | ||
- os: alma9 | ||
file: doc/MaCh3DockerFiles/Alma9/Dockerfile | ||
tag_latest: alma9latest | ||
|
||
name: Image CD ${{ matrix.os }} | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Log in to GitHub Container Registry | ||
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin | ||
|
||
- name: Build Docker image | ||
run: | | ||
if [ "${{ github.ref_type }}" == "tag" ]; then | ||
docker build . \ | ||
--file "${{ matrix.file }}" \ | ||
--tag "ghcr.io/dune/mach3:${{ matrix.os }}${{ github.ref_name }}" \ | ||
--build-arg MACH3_DUNE_VERSION="${{ github.ref_name }}" | ||
else | ||
docker build . \ | ||
--file "${{ matrix.file }}" \ | ||
--tag "ghcr.io/dune/mach3:${{ matrix.tag_latest }}" \ | ||
--build-arg MACH3_DUNE_VERSION="develop" | ||
fi | ||
- name: Push Docker image | ||
run: | | ||
if [ "${{ github.ref_type }}" == "tag" ]; then | ||
docker push "ghcr.io/dune/mach3:${{ matrix.os }}${{ github.ref_name }}" | ||
else | ||
docker push "ghcr.io/dune/mach3:${{ matrix.tag_latest }}" | ||
fi | ||
- name: Delete old images | ||
uses: actions/delete-package-versions@v5 | ||
with: | ||
package-name: 'mach3' | ||
package-type: 'container' | ||
min-versions-to-keep: 5 | ||
delete-only-untagged-versions: 'true' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
--- | ||
# Check if MaCh3 compiles correctly | ||
|
||
name: Build CI | ||
|
||
# The events that trigger the workflow | ||
on: | ||
pull_request: | ||
branches: [ develop ] | ||
|
||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false # KS: Prevents cancellation of remaining jobs if one fails | ||
matrix: | ||
include: | ||
- os: Alma9 | ||
file: doc/MaCh3DockerFiles/Alma9/Dockerfile | ||
tag: alma9latest | ||
# - os: Rocky9 | ||
# file: doc/MaCh3DockerFiles/Rocky9/Dockerfile | ||
# tag: rocky9latest | ||
|
||
name: Build CI ${{ matrix.os }} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Log in to GitHub Container Registry | ||
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin | ||
|
||
- name: Build the Docker image | ||
run: | | ||
docker build . \ | ||
--file ${{ matrix.file }} \ | ||
--tag ghcr.io/dune/mach3:${{ matrix.tag }} \ | ||
--build-arg MACH3_DUNE_VERSION=${{ github.head_ref }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: Greetings | ||
|
||
on: [pull_request_target, issues] | ||
|
||
jobs: | ||
greeting: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
issues: write | ||
pull-requests: write | ||
steps: | ||
- uses: actions/first-interaction@v1 | ||
with: | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
issue-message: "This is your first issue, thank you for contributing to MaCh3 DUNE!" | ||
pr-message: "This is your first PR, thank you for contributing to MaCh3 DUNE!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#To run use: docker build --secret id=tokens,src=tokens.txt -t mach3dune . | ||
FROM picker24/root_v6_26_10:alma9 AS mach3dune_build | ||
|
||
# Declare the build argument | ||
ARG MACH3_DUNE_VERSION | ||
ENV MACH3_DUNE_VERSION=${MACH3_DUNE_VERSION:-develop} | ||
|
||
ENV MACH3_DUNE_WORK_DIR=/opt/MaCh3DUNE/ | ||
ENV MACH3_DUNE_INSTALL_DIR=${MACH3_DUNE_WORK_DIR}/build | ||
|
||
|
||
RUN git clone https://github.com/DUNE/MaCh3_DUNE.git ${MACH3_DUNE_WORK_DIR} | ||
|
||
WORKDIR ${MACH3_DUNE_WORK_DIR} | ||
RUN git checkout ${MACH3_DUNE_VERSION} | ||
|
||
RUN mkdir -p ${MACH3_DUNE_INSTALL_DIR} | ||
WORKDIR ${MACH3_DUNE_INSTALL_DIR} | ||
|
||
RUN cmake ../ | ||
|
||
RUN make -j && make install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#To run use: docker build --secret id=tokens,src=tokens.txt -t mach3dune . | ||
FROM picker24/root_v6_26_10:alma9 AS mach3dune_build | ||
|
||
# Declare the build argument | ||
ARG MACH3_DUNE_VERSION | ||
ENV MACH3_DUNE_VERSION=${MACH3_DUNE_VERSION:-develop} | ||
|
||
ENV MACH3_DUNE_WORK_DIR=/opt/MaCh3DUNE/ | ||
ENV MACH3_DUNE_INSTALL_DIR=${MACH3_DUNE_WORK_DIR}/build | ||
|
||
RUN git clone https://github.com/DUNE/MaCh3_DUNE.git ${MACH3_DUNE_WORK_DIR} | ||
|
||
WORKDIR ${MACH3_DUNE_WORK_DIR} | ||
RUN git checkout ${MACH3_DUNE_VERSION} | ||
|
||
RUN mkdir -p ${MACH3_DUNE_INSTALL_DIR} | ||
WORKDIR ${MACH3_DUNE_INSTALL_DIR} | ||
|
||
RUN cmake ../ | ||
|
||
RUN make -j && make install |