-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This patch migrates CI from Travis to Github Actions. There are 2 stages: - Build stage: Where the actual build happens - Test stage: Where the tests are executed Build artifacts are uploaded to the workflow Signed-off-by: Dinesh Prasanth M K <[email protected]>
- Loading branch information
1 parent
b7f0975
commit e5eff20
Showing
7 changed files
with
107 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
name: Required Tests | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
build: | ||
name: Build | ||
strategy: | ||
matrix: | ||
os: ['30', '31'] | ||
runs-on: ubuntu-latest | ||
container: fedora:${{ matrix.os }} | ||
steps: | ||
|
||
- name: Install required packages | ||
run: dnf install -y dnf-plugins-core rpm-build git | ||
|
||
- name: Clone the repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Enable PKI COPR repo | ||
run: dnf copr -y enable @pki/master | ||
|
||
- name: Installed build deps | ||
run: dnf builddep -y --spec ldapjdk.spec | ||
|
||
- name: Build artifacts | ||
run: ./build.sh --with-timestamp --with-commit-id --work-dir=../packages rpm | ||
|
||
- name: Compress RPMS | ||
run: tar -czf ldapjdk-rpms.tar.gz ../packages/RPMS/* | ||
|
||
# upload-artifact runs on host-vm rather than inside the container. Fixed in v2 (unreleased) | ||
# Bug: https://github.com/actions/upload-artifact/issues/13#issuecomment-532936650 | ||
- name: Upload RPM artifacts | ||
uses: actions/upload-artifact@v1 | ||
with: | ||
name: ldapjdk-build-${{ matrix.os }} | ||
path: ldapjdk-rpms.tar.gz | ||
|
||
test: | ||
name: Tests | ||
needs: build | ||
strategy: | ||
matrix: | ||
os: ['30', '31'] | ||
runs-on: ubuntu-latest | ||
env: | ||
LDAPJDKDIR: /tmp/workdir/ldapjdk | ||
CONTAINER: ldapjdk-test | ||
steps: | ||
- name: Clone the repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Download ldapjdk binaries from Build job | ||
uses: actions/download-artifact@v1 | ||
with: | ||
name: ldapjdk-build-${{ matrix.os }} | ||
|
||
- name: Extract tar.gz for rpms | ||
run: tar -xzf ldapjdk-build-${{ matrix.os }}/ldapjdk-rpms.tar.gz | ||
|
||
- name: Setup required test environment | ||
run: IMAGE=fedora:${{ matrix.os }} ci/container-init.sh | ||
|
||
- name: Install required packages | ||
run: | | ||
docker exec -i ${CONTAINER} rm -f /var/cache/dnf/metadata_lock.pid | ||
docker exec -i ${CONTAINER} bash -c "dnf update -y && dnf clean all" | ||
docker exec -i ${CONTAINER} dnf install -y 389-ds-base-legacy-tools findutils dnf-plugins-core sudo 389-ds-base | ||
- name: Enable PKI COPR repo | ||
run: docker exec -i ${CONTAINER} dnf copr -y enable @pki/master | ||
|
||
- name: Install ldapjdk packages from Build job | ||
run: docker exec -i ${CONTAINER} bash -c "find ${LDAPJDKDIR}/packages/ -name '*.rpm' | xargs dnf -y install" | ||
|
||
- name: Create DS instance | ||
run: docker exec -i ${CONTAINER} ${LDAPJDKDIR}/ci/ds-create.sh | ||
|
||
- name: Run ldapjdk Tests | ||
run: docker exec -i ${CONTAINER} ${LDAPJDKDIR}/ci/tools-test.sh | ||
|
||
- name: Remove DS instance | ||
run: docker exec -i ${CONTAINER} ${LDAPJDKDIR}/ci/ds-remove.sh |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/bash -ex | ||
|
||
docker pull registry.fedoraproject.org/${IMAGE} | ||
|
||
docker run \ | ||
--name ${CONTAINER} \ | ||
--hostname server.example.com \ | ||
--tmpfs /tmp \ | ||
--tmpfs /run \ | ||
--volume /sys/fs/cgroup:/sys/fs/cgroup:ro \ | ||
--volume ${GITHUB_WORKSPACE}:${LDAPJDKDIR} \ | ||
-e LDAPJDKDIR="${LDAPJDKDIR}" \ | ||
--detach \ | ||
-i \ | ||
registry.fedoraproject.org/${IMAGE} \ | ||
"/usr/sbin/init" |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.