Skip to content

Commit

Permalink
add rpm test
Browse files Browse the repository at this point in the history
  • Loading branch information
guyzsarun committed Aug 9, 2023
1 parent a196da8 commit bd52d13
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 1 deletion.
20 changes: 20 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ jobs:

test-json:
name: Test JSON Conversion
needs: build
runs-on: ubuntu-latest
steps:
- name: Check out Git repository
Expand All @@ -50,3 +51,22 @@ jobs:
run: |
docker run --rm ${{ env.BASE_TAG }} python3 -m pytest -v
test-rpm:
name: Package RPM
needs: build
runs-on: ubuntu-latest
steps:
- name: Check out Git repository
uses: actions/checkout@v2

- uses: docker/setup-buildx-action@v2

- name: Build Docker image
uses: docker/build-push-action@v4
with:
context: .
file: docker/Dockerfile.rpm
load: true
cache-from: type=gha
cache-to: type=gha,mode=max

2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ RUN yum -y update && \

RUN dnf group install -y "Development Tools"

# CMS json dependency
# CMS TFC dependency
RUN yum install -y cmake \
wget \
xrootd \
Expand Down
36 changes: 36 additions & 0 deletions docker/Dockerfile.rpm
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
FROM almalinux:8
MAINTAINER Sarun Nuntaviriyakul <[email protected]>
LABEL org.opencontainers.image.source https://github.com/guyzsarun/xrootd-cmsjson

WORKDIR /xrootd

RUN yum -y update && \
yum install -y dnf \
https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm \
https://repo.opensciencegrid.org/osg/3.6/osg-3.6-el8-release-latest.rpm \
epel-release

RUN dnf group install -y "Development Tools"

# CMS TFC dependency
RUN yum install -y cmake \
wget \
xrootd \
python3-devel \
python3-xrootd \
xrootd-devel \
pcre-devel \
xerces-c-devel \
xrootd-devel \
https://cbs.centos.org/kojifiles/packages/jsoncpp/1.9.4/4.el8s/x86_64/jsoncpp-1.9.4-4.el8s.x86_64.rpm \
https://cbs.centos.org/kojifiles/packages/jsoncpp/1.9.4/4.el8s/x86_64/jsoncpp-devel-1.9.4-4.el8s.x86_64.rpm


COPY . .

RUN mkdir -p /root/rpmbuild/SOURCES
RUN tar -zvcf /root/rpmbuild/SOURCES/xrootd-cmstfc.tar.gz --transform s/xrootd/xrootd-cmstfc-2.0.0/ ../xrootd

RUN rpmbuild -bb spec/xrootd-cmstfc.spec

RUN yum install -y /root/rpmbuild/RPMS/x86_64/xrootd-cmstfc-2.0.0-1.el8.x86_64.rpm

0 comments on commit bd52d13

Please sign in to comment.