Skip to content

Add rpm

Add rpm #38

Workflow file for this run

name: build
on:
push
env:
TEST_TAG: user/cmsjson:test
LATEST_TAG: ghcr.io/guyzsarun/xrootd-cmsjson:latest
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check out Git repository
uses: actions/checkout@v2
- uses: docker/setup-buildx-action@v1
- name: Build Docker image
uses: docker/build-push-action@v4
with:
context: .
file: docker/Dockerfile
tags: ${{ env.LATEST_TAG }}
load: true
cache-from: type=gha
cache-to: type=gha,mode=max
test-json:
runs-on: ubuntu-latest
needs: build
steps:
- name: Check out Git repository
uses: actions/checkout@v2
- uses: docker/setup-buildx-action@v1
- name: Build Docker image
uses: docker/build-push-action@v4
with:
context: .
file: docker/Dockerfile
load: true
tags: ${{ env.TEST_TAG }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Unit test
run: |
docker run --rm ${{ env.TEST_TAG }} python3 -m pytest -v
test-rpm:
runs-on: ubuntu-latest
needs: build
steps:
- name: Check out Git repository
uses: actions/checkout@v2
- uses: docker/setup-buildx-action@v1
- name: Build Docker image
uses: docker/build-push-action@v4
with:
context: .
file: docker/Dockerfile
load: true
tags: ${{ env.TEST_TAG }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Unit test
run: |
docker run --rm ${{ env.TEST_TAG }} bash -c '
mkdir -p /root/rpmbuild/SOURCES/ &&
tar -cvf /root/rpmbuild/SOURCES/xrootd-cmsjson.tar.gz . &&
rpmbuild -bb spec/xrootd-cmsjson.spec
'
push-registry:
runs-on: ubuntu-latest
needs: test

Check failure on line 81 in .github/workflows/main.yaml

View workflow run for this annotation

GitHub Actions / build

Invalid workflow file

The workflow is not valid. .github/workflows/main.yaml (Line: 81, Col: 12): Job 'push-registry' depends on unknown job 'test'.
steps:
- name: Check out Git repository
uses: actions/checkout@v2
- uses: docker/setup-buildx-action@v1
- name: Build Docker image
uses: docker/build-push-action@v4
with:
context: .
file: docker/Dockerfile
tags: ${{ env.LATEST_TAG }}
load: true
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Push to registry
if: always() && github.ref == 'refs/heads/master'
run: docker push ${{ env.LATEST_TAG }}