Skip to content

Commit

Permalink
Do not install ci scripts into bin/
Browse files Browse the repository at this point in the history
  • Loading branch information
felixsch committed Feb 6, 2024
1 parent ebed7b5 commit fd2c2fa
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 26 deletions.
48 changes: 40 additions & 8 deletions .github/workflows/features.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,24 @@
---

name: RMT feature tests

on:
pull_request:
branches: [master]

env:
SOURCE: /usr/src/rmt-server
SCC_USERNAME: ${{ secrets.SCC_USERNAME }}
SCC_PASSWORD: ${{ secrets.SCC_PASSWORD }}

# Within containters Github Actions does create a bridged network exposing
# the service named after its label
MYSQL_HOST: mysql

jobs:
feature-tests:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
working-directory: /usr/src/rmt-server
container:
image: registry.opensuse.org/systemsmanagement/scc/containers/15.5/rmt-ci-container:latest
Expand All @@ -35,14 +43,38 @@ jobs:
with:
fetch-depth: 0

- name: build rpm
- name: move source to /usr/src/rmt-server
run: |
[ -d $SOURCE ] && rm -r $SOURCE
cp -r $GITHUB_WORKSPACE $SOURCE
- name: cache vendor directory
id: vendor-cache
uses: actions/cache@v4
with:
path: ${{ env.SOURCE }}/vendor/
key: vendor-cache

- name: update vendor cache
if: steps.vendor-cache.outputs.cache-hit != 'true'
run: |
bundle install
bundle package --all
- name: update gem depdendencies
run: |
rmt-build-rpm
bundle install
- name: configure rmt
- name: build RPM package
run: |
rmt-configure
bash ci/rmt-build-rpm
- name: gather RPM build artifacts
uses: actions/upload-artifact@v4
with:
name: rmt-server-rpms
path: ${{ env.SOURCE }}/tmp/artifacts/*.rpm

- name: run feature tests
- name: configure RMT to run feature tests
run: |
rmt-run-feature-tests
bash ci/rmt-configure
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ clean:
rm -rf $(NAME)-$(VERSION)/

man:
bundle exec ronn --roff --pipe --manual RMT MANUAL.md > rmt-cli.8 && gzip -f rmt-cli.8
ronn --roff --pipe --manual RMT MANUAL.md > rmt-cli.8 && gzip -f rmt-cli.8
mv rmt-cli.8.gz package/obs

dist: clean man
Expand Down
18 changes: 1 addition & 17 deletions ci/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,5 @@ RUN zypper --non-interactive in make chrpath fdupes gcc libcurl-devel libffi-dev
RUN update-alternatives --install /usr/bin/bundle bundle /usr/bin/bundle.ruby2.5 5 && \
update-alternatives --install /usr/bin/bundler bundler /usr/bin/bundler.ruby2.5 5

VOLUME /usr/src/rmt-server
VOLUME /usr/

ARG SCC_USERNAME
ARG SCC_PASSWORD

# Prepare ruby environment
ENV NOKOGIRI_USE_SYSTEM_LIBRARIES 1

# Add rmt ci/development scripts
RUN mkdir -p /usr/src/rmt-server /usr/local/bin

COPY rmt-build-rpm /usr/local/bin/
COPY rmt-configure /usr/local/bin/
COPY rmt-console /usr/local/bin/
COPY rmt-run-feature-tests /usr/local/bin/

RUN mkdir /usr/src/rmt-server
WORKDIR /usr/src/rmt-server
1 change: 1 addition & 0 deletions ci/rmt-build-rpm
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,6 @@ group "build rmt-server-$VERSION.x86_64.rpm"
pushd $BUILD_DIR
rpmbuild -ba --define '_srcdefattr (-,root,root)' --nosignature --undefine _enable_debug_packages SOURCES/rmt-server.spec
cp -r RPMS/x86_64/rmt-server-$VERSION*.rpm $ARTIFACT_DIR/
cp -r RPMS/x86_64/rmt-server-config-$VERSION*.rpm $ARTIFACT_DIR/
popd
groupend

0 comments on commit fd2c2fa

Please sign in to comment.