Skip to content

Commit

Permalink
Workflow optimization (2)
Browse files Browse the repository at this point in the history
  • Loading branch information
maxirmx committed Jan 24, 2024
1 parent 46cfbfb commit 06bd79e
Showing 1 changed file with 63 additions and 3 deletions.
66 changes: 63 additions & 3 deletions .github/workflows/time-machine.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: centos-and-fedora
name: time-machine
on:
push:
branches:
Expand All @@ -16,7 +16,7 @@ env:
RNP_LOG_CONSOLE: 1

jobs:
tests:
build:
name: ${{ matrix.image.name }} [CC ${{ matrix.env.CC }}; backend ${{ matrix.image.backend }}; date offset ${{ matrix.date-offset }}]
runs-on: ubuntu-latest
timeout-minutes: 120
Expand Down Expand Up @@ -72,9 +72,16 @@ jobs:
- name: Build
run: cmake --build build --parallel ${{ env.CORES }}

- name: Package rpm
- name: Package RPM files
run: cpack -G RPM -B rpm --config build/CPackConfig.cmake

- name: Upload RPM files
uses: actions/upload-artifact@v3
with:
name: 'RPM-${{ matrix.env.CC }}-${{ matrix.image.backend }}'
path: 'rpm/*.rpm'
retention-days: 5

- name: Test
run: |
set -o errexit -o pipefail -o noclobber -o nounset
Expand All @@ -87,3 +94,56 @@ jobs:
export PATH="$PWD/build/src/lib:$PATH"
chown -R rnpuser:rnpuser $PWD
exec su rnpuser -c "LD_PRELOAD=/usr/lib64/faketime/libfaketime.so.1 ctest --parallel ${{ env.CORES }} --test-dir build --output-on-failure"
test:
name: ${{ matrix.image.name }} [CC ${{ matrix.env.CC }}; backend ${{ matrix.image.backend }}; date offset ${{ matrix.date-offset }}]
runs-on: ubuntu-latest
needs: build
timeout-minutes: 120
strategy:
fail-fast: false
matrix:
env:
- { CC: clang, CXX: clang++ }

# Pls refer to https://github.com/rnpgp/rnp-ci-containers#readme for image details
image:
- { name: 'Fedora 36', container: 'fedora-36-amd64', backend: 'Botan' }
- { name: 'Fedora 36', container: 'fedora-36-amd64', backend: 'OpenSSL' }

date-offset:
- '0 years'
- '1 year'
- '5 years'

container: ghcr.io/rnpgp/ci-rnp-${{ matrix.image.container }}

env: ${{ matrix.env }}
steps:
- name: Install tools
run: dnf -y install libfaketime

- name: Setup environment
run: |
set -o errexit -o pipefail -o noclobber -o nounset
/opt/tools/tools.sh select_crypto_backend_for_gha ${{ matrix.image.backend }}
/opt/tools/tools.sh select_gpg_version_for_gha 'system'
/opt/tools/tools.sh select_botan_version_for_gha 'system'
echo CORES="$(nproc --all)" >> $GITHUB_ENV
useradd rnpuser
printf "\nrnpuser\tALL=(ALL)\tNOPASSWD:\tALL" > /etc/sudoers.d/rnpuser
printf "\nrnpuser\tsoft\tnproc\tunlimited\n" > /etc/security/limits.d/30-rnpuser.conf
- name: Download RPM files
uses: actions/download-artifact@v3
with:
name: 'RPM-${{ matrix.env.CC }}-${{ matrix.image.backend }}'
path: 'rpm/*.rpm'
retention-days: 5

- name: Install RPM files
run: dnf -y install rpm/*.rpm

0 comments on commit 06bd79e

Please sign in to comment.