Skip to content

Commit

Permalink
github: install pinned osbuild commit for unit tests
Browse files Browse the repository at this point in the history
Run the setup-osbuild-repo script before running unit tests in github
actions to get the pinned osbuild-depsolve-dnf rpm.

Some steps had to be reordered for this.  The repo setup requires the
repository to be checked out and the dependency installation should
happen after the osbuild repo setup.
  • Loading branch information
achilleas-k committed Apr 11, 2024
1 parent bdbfbf1 commit 99332b9
Showing 1 changed file with 22 additions and 11 deletions.
33 changes: 22 additions & 11 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,20 @@ jobs:
image: registry.fedoraproject.org/fedora:latest

steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Set up repository for pinned osbuild commit
run: ./test/scripts/setup-osbuild-repo

# krb5-devel is needed to test internal/upload/koji package
# gcc is needed to build the mock depsolver binary for the unit tests
# gpgme-devel is needed for container upload dependencies
- name: Install build and test dependencies
run: dnf -y install krb5-devel gcc git-core go gpgme-devel osbuild-depsolve-dnf btrfs-progs-devel device-mapper-devel

- name: Check out code into the Go module directory
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Mark the working directory as safe for git
run: git config --global --add safe.directory "$(pwd)"

Expand All @@ -55,14 +58,17 @@ jobs:
- name: Enable crb repo
run: dnf config-manager --set-enabled crb

- name: Install build and test dependencies
run: dnf -y install krb5-devel gcc git-core go gpgme-devel osbuild-depsolve-dnf device-mapper-devel

- name: Check out code into the Go module directory
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Set up repository for pinned osbuild commit
run: ./test/scripts/setup-osbuild-repo

- name: Install build and test dependencies
run: dnf -y install krb5-devel gcc git-core go gpgme-devel osbuild-depsolve-dnf device-mapper-devel

- name: Mark the working directory as safe for git
run: git config --global --add safe.directory "$(pwd)"

Expand All @@ -87,14 +93,19 @@ jobs:
- name: Enable powertools repo
run: dnf config-manager --set-enabled powertools

- name: Install build and test dependencies
run: dnf -y install krb5-devel gcc git-core go gpgme-devel osbuild-depsolve-dnf device-mapper-devel

- name: Check out code into the Go module directory
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Set up repository for pinned osbuild commit
run: |
dnf -y install python3
./test/scripts/setup-osbuild-repo
- name: Install build and test dependencies
run: dnf -y install krb5-devel gcc git-core go gpgme-devel osbuild-depsolve-dnf device-mapper-devel

- name: Mark the working directory as safe for git
run: git config --global --add safe.directory "$(pwd)"

Expand Down

0 comments on commit 99332b9

Please sign in to comment.