-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
) * chore(ci): migrate some CI from Jenkins to github actions (#9795) * chore(Make): add the convenience make tasks * chore(gha): migrate test package and unofficial packaging from Jenkins to GHA * chore(dev): can the rockspec be renamed so we don't overwrite unofficial tagged version? * chore(ci): revert the rockspec rename * fix(ci): we don't need to docker login for CE test packaging * chore(ci): we need to keep building alpine unofficial in Jenkins (cherry picked from commit b1a1f07) * fix(submodule): removing a submodule I believe was accidentally committed
- Loading branch information
Showing
4 changed files
with
235 additions
and
38 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,126 @@ | ||
name: Package & Smoke Test | ||
|
||
on: # yamllint disable-line rule:truthy | ||
pull_request: | ||
push: | ||
branches: | ||
- master | ||
- next/* | ||
- release/* | ||
|
||
env: | ||
DOCKER_REPOSITORY: kong/kong-build-tools | ||
|
||
jobs: | ||
package-and-test: | ||
if: github.event_name == 'pull_request' | ||
name: Build & Smoke Test Packages | ||
runs-on: ubuntu-22.04 | ||
|
||
steps: | ||
- name: Swap git with https | ||
run: git config --global url."https://github".insteadOf git://github | ||
|
||
- name: Setup some environment variables | ||
run: | | ||
echo "KONG_SOURCE_LOCATION=$GITHUB_WORKSPACE/kong-src" >> $GITHUB_ENV | ||
echo "KONG_BUILD_TOOLS_LOCATION=$GITHUB_WORKSPACE/kong-build-tools" >> $GITHUB_ENV | ||
- name: Checkout Kong source code | ||
uses: actions/checkout@v3 | ||
with: | ||
path: ${{ env.KONG_SOURCE_LOCATION }} | ||
submodules: recursive | ||
token: ${{ secrets.GHA_KONG_BOT_READ_TOKEN }} | ||
|
||
- name: Setup kong-build-tools | ||
run: | | ||
pushd ${{ env.KONG_SOURCE_LOCATION }} | ||
make setup-kong-build-tools | ||
- name: Setup package naming environment variables | ||
run: | | ||
grep -v '^#' ${{ env.KONG_SOURCE_LOCATION}}/.requirements >> $GITHUB_ENV | ||
- name: Package & Test | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GHA_KONG_BOT_READ_TOKEN }} | ||
run: | | ||
pushd ${{ env.KONG_SOURCE_LOCATION }} | ||
make package/test/deb | ||
package-test-and-unofficial-release: | ||
if: github.event_name == 'push' | ||
name: Build & Smoke & Unofficial Release Packages | ||
runs-on: ubuntu-22.04 | ||
strategy: | ||
matrix: | ||
package_type: [deb, rpm, apk] | ||
|
||
steps: | ||
- name: Login to Docker Hub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.GHA_DOCKERHUB_PUSH_USER }} | ||
password: ${{ secrets.GHA_KONG_ORG_DOCKERHUB_PUSH_TOKEN }} | ||
|
||
- name: Swap git with https | ||
run: git config --global url."https://github".insteadOf git://github | ||
|
||
- name: Setup directory environment variables | ||
run: | | ||
echo "KONG_SOURCE_LOCATION=$GITHUB_WORKSPACE/kong-src" >> $GITHUB_ENV | ||
echo "KONG_BUILD_TOOLS_LOCATION=$GITHUB_WORKSPACE/kong-build-tools" >> $GITHUB_ENV | ||
- name: Checkout Kong source code | ||
uses: actions/checkout@v3 | ||
with: | ||
path: ${{ env.KONG_SOURCE_LOCATION }} | ||
submodules: recursive | ||
token: ${{ secrets.GHA_KONG_BOT_READ_TOKEN }} | ||
|
||
- name: Setup kong-build-tools | ||
run: | | ||
pushd ${{ env.KONG_SOURCE_LOCATION }} | ||
make setup-kong-build-tools | ||
- name: Setup package naming environment variables | ||
run: | | ||
grep -v '^#' ${{ env.KONG_SOURCE_LOCATION}}/.requirements >> $GITHUB_ENV | ||
echo "DOCKER_RELEASE_REPOSITORY=kong/kong" >> $GITHUB_ENV | ||
echo "KONG_TEST_CONTAINER_TAG=$GITHUB_REF_NAME-${{ matrix.package_type }}" >> $GITHUB_ENV | ||
if [[ ${{matrix.package_type }} == "apk" ]]; then | ||
echo "ADDITIONAL_TAG_LIST=$GITHUB_REF_NAME-alpine" >> $GITHUB_ENV | ||
fi | ||
if [[ ${{matrix.package_type }} == "deb" ]]; then | ||
echo "ADDITIONAL_TAG_LIST=$GITHUB_REF_NAME-debian $GITHUB_REF_NAME $GITHUB_SHA" >> $GITHUB_ENV | ||
fi | ||
- name: Package & Test | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GHA_KONG_BOT_READ_TOKEN }} | ||
run: | | ||
pushd ${{ env.KONG_SOURCE_LOCATION }} | ||
make package/test/${{ matrix.package_type }} | ||
- name: Push Docker Image | ||
env: | ||
SKIP_TESTS: true | ||
run: | | ||
pushd ${{ env.KONG_SOURCE_LOCATION }} | ||
make release/docker/${{ matrix.package_type }} | ||
- name: Store the package artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{ matrix.package_type }} | ||
path: ${{ env.KONG_BUILD_TOOLS_LOCATION }}/output/* | ||
|
||
- name: Comment on commit | ||
continue-on-error: true | ||
uses: peter-evans/commit-comment@v2 | ||
with: | ||
token: ${{ secrets.GHA_COMMENT_TOKEN }} | ||
body: | | ||
Docker image avaialble ${{ env.DOCKER_RELEASE_REPOSITORY }}:${{ env.KONG_TEST_CONTAINER_TAG }} | ||
Artifacts availabe https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} |
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
Oops, something went wrong.