Skip to content

Commit

Permalink
Merge pull request #5067 from rjbou/gha
Browse files Browse the repository at this point in the history
GHA: add gentoo depext test
  • Loading branch information
rjbou authored Apr 1, 2022
2 parents 7116ccd + 56e7d6f commit c830b25
Show file tree
Hide file tree
Showing 6 changed files with 62 additions and 11 deletions.
34 changes: 27 additions & 7 deletions .github/scripts/depexts/generate-actions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -eu

#for target in alpine debian archlinux centos opensuse fedora oraclelinux ubuntu; do
#for target in alpine archlinux centos debian fedora gentoo opensuse oraclelinux ubuntu; do
target=$1
dir=.github/actions/$target

Expand Down Expand Up @@ -57,6 +57,19 @@ EOF
FROM fedora
RUN dnf install -y $mainlibs $ocaml diffutils
RUN dnf install -y gcc-c++
EOF
;;
gentoo)
mainlibs=${mainlibs/git/dev-vcs\/git}
mainlibs=${mainlibs/tar/app-arch\/tar}
cat >$dir/Dockerfile << EOF
# name the portage image
FROM gentoo/portage as portage
# image is based on stage3
FROM gentoo/stage3
# copy the entire portage volume in
COPY --from=portage /var/db/repos/gentoo /var/db/repos/gentoo
RUN emerge -qv $mainlibs
EOF
;;
opensuse)
Expand Down Expand Up @@ -130,18 +143,25 @@ eval \$(opam env)
make
./opam config report
./opam switch create confs --empty
./opam install conf-gmp
./opam install conf-which
./opam install conf-autoconf
EOF

test_depext () {
for pkg in $@ ; do
echo "./opam install $pkg || true" >> $dir/entrypoint.sh
done
}

test_depext conf-gmp conf-which conf-autoconf

# disable automake for centos, as os-family returns rhel
if [ $target != "centos" ] && [ $target != "opensuse" ]; then
cat >>$dir/entrypoint.sh << EOF
./opam install conf-automake
EOF
test_depext conf-automake
fi

# additionnal
test_depext dpkg # gentoo
test_depext lib-sundials-dev # os version check

chmod +x $dir/entrypoint.sh

#done
5 changes: 3 additions & 2 deletions .github/workflows/ci.ml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ on:
- '*.opam'
- 'Makefile*'
- 'configure*'
- '.github/**'
pull_request:
paths:
- 'src/**'
Expand All @@ -49,7 +48,9 @@ on:
- '*.opam'
- 'Makefile*'
- 'configure*'
- '.github/**'
- '.github/scripts/main/**'
- '.github/scripts/common/**'
- '.github/workflows/main.yml'
- 'tests/**'
# paths-ignore:
# - 'release/**'
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/depexts.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
name: depexts

on:
pull_request:
paths:
- 'src/state/opamSysInteract.ml'
- '.github/workflows/depexts.yml'
- '.github/scripts/depexts/**'
push:
paths:
- 'src/state/opamSysInteract.ml'

defaults:
run:
Expand Down Expand Up @@ -121,6 +127,24 @@ jobs:
uses: ./.github/actions/fedora
id: depexts-fedora

depexts-gentoo:
needs: opam-cache
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: opam binary cache
uses: actions/cache@v2
with:
path: binary/opam
key: binary-${{ env.OPAMVERSION }}
- name: generate action
run: |
bash .github/scripts/depexts/generate-actions.sh gentoo
- name: depexts actions gentoo
uses: ./.github/actions/gentoo
id: depexts-gentoo

depexts-opensuse:
needs: opam-cache
runs-on: ubuntu-latest
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ on:
- '*.opam'
- 'Makefile*'
- 'configure*'
- '.github/**'
pull_request:
paths:
- 'src/**'
Expand All @@ -22,7 +21,9 @@ on:
- '*.opam'
- 'Makefile*'
- 'configure*'
- '.github/**'
- '.github/scripts/main/**'
- '.github/scripts/common/**'
- '.github/workflows/main.yml'
- 'tests/**'
# paths-ignore:
# - 'release/**'
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/scripts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ on:
pull_request:
paths:
- 'shell/install.sh'
- '.github/workflows/scripts.yml'
- '.github/scripts/scripts/hygiene.sh'
- '.github/scripts/common/hygiene-preamble.sh'

defaults:
run:
Expand Down
2 changes: 2 additions & 0 deletions master_changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,8 @@ users)
* Arrange scripts directory [#4922 @rjbou]
* Run ci on tests changes [#4966 @rjbou]
* GHA: Fix caching for the "test" job [#5090 @dra27 @kit-ty-kate]
* Add gentoo depext test [#5067 @rjbou]
* Add more constraint path for launch of workflow [#5067 @rjbou]

## Shell
* fish: fix deprecated redirection syntax `^` [#4736 @vzaliva]
Expand Down

0 comments on commit c830b25

Please sign in to comment.