Skip to content

Commit

Permalink
fix(linux): Restore artifacts for API verification in the correct job
Browse files Browse the repository at this point in the history
Previously we had an extra job where we setup the environment and
restored the artifacts. However, the artifacts then were no longer
available in the next job, `api_verification`. Instead of restoring
the artifacts a second time this change squashes the two jobs. This will
hopefully fix the API verification.
  • Loading branch information
ermshiperete committed May 27, 2024
1 parent 7d9b1a1 commit 32bc9e7
Showing 1 changed file with 13 additions and 18 deletions.
31 changes: 13 additions & 18 deletions .github/workflows/api-verification.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ env:
GH_TOKEN: ${{ github.token }}

jobs:
setup_environment:
api_verification:
name: Verify API for libkeymancore.so
runs-on: ubuntu-latest
outputs:
VERSION: ${{ steps.environment_step.outputs.VERSION }}
Expand All @@ -37,21 +38,15 @@ jobs:
run: |
cat artifacts/env >> $GITHUB_OUTPUT
api_verification:
name: Verify API for libkeymancore.so
needs: setup_environment
runs-on: ubuntu-latest

steps:
- name: Set pending status on PR builds
id: set_status
if: needs.setup_environment.outputs.IS_TEST_BUILD == 'true'
if: steps.environment_step.outputs.IS_TEST_BUILD == 'true'
shell: bash
run: |
gh api \
--method POST \
-H "Accept: application/vnd.github+json" \
/repos/$GITHUB_REPOSITORY/statuses/${{ needs.setup_environment.outputs.GIT_SHA }} \
/repos/$GITHUB_REPOSITORY/statuses/${{ steps.environment_step.outputs.GIT_SHA }} \
-f state='pending' \
-f target_url="$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" \
-f description='API verification started' \
Expand All @@ -60,26 +55,26 @@ jobs:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1
with:
ref: '${{ needs.setup_environment.outputs.GIT_SHA }}'
ref: '${{ steps.environment_step.outputs.GIT_SHA }}'
fetch-depth: 0

- name: Install devscripts
uses: ./.github/actions/apt-install
with:
packages: devscripts equivs

- name: "Verify API for libkeymancore.so (${{ needs.setup_environment.outputs.GIT_BRANCH }}, branch ${{ needs.setup_environment.outputs.GIT_BASE_BRANCH }}, by ${{ needs.setup_environment.outputs.GIT_USER }}) - "
- name: "Verify API for libkeymancore.so (${{ steps.environment_step.outputs.GIT_BRANCH }}, branch ${{ steps.environment_step.outputs.GIT_BASE_BRANCH }}, by ${{ steps.environment_step.outputs.GIT_USER }}) - "
run: |
ls -al ${GITHUB_WORKSPACE}
ls -al ${GITHUB_WORKSPACE}/artifacts/
ls -al "${GITHUB_WORKSPACE}/artifacts/${PKG_NAME}_${{ needs.setup_environment.outputs.VERSION }}-1${{ needs.setup_environment.outputs.PRERELEASE_TAG }}+$(lsb_release -c -s)1_amd64.deb"
ls -al "${GITHUB_WORKSPACE}/artifacts/${PKG_NAME}_${{ steps.environment_step.outputs.VERSION }}-1${{ steps.environment_step.outputs.PRERELEASE_TAG }}+$(lsb_release -c -s)1_amd64.deb"
cd linux
./scripts/deb-packaging.sh \
--gha \
--bin-pkg "${GITHUB_WORKSPACE}/artifacts/${PKG_NAME}_${{ needs.setup_environment.outputs.VERSION }}-1${{ needs.setup_environment.outputs.PRERELEASE_TAG }}+$(lsb_release -c -s)1_amd64.deb" \
--git-sha "${{ needs.setup_environment.outputs.GIT_SHA }}" \
--git-base "${{ needs.setup_environment.outputs.GIT_BASE }}" \
--bin-pkg "${GITHUB_WORKSPACE}/artifacts/${PKG_NAME}_${{ steps.environment_step.outputs.VERSION }}-1${{ steps.environment_step.outputs.PRERELEASE_TAG }}+$(lsb_release -c -s)1_amd64.deb" \
--git-sha "${{ steps.environment_step.outputs.GIT_SHA }}" \
--git-base "${{ steps.environment_step.outputs.GIT_BASE }}" \
verify 2>> $GITHUB_STEP_SUMMARY
- name: Archive .symbols file
Expand All @@ -91,9 +86,9 @@ jobs:

set_status:
name: Set result status on PR builds
needs: [setup_environment, api_verification]
needs: [api_verification]
runs-on: ubuntu-latest
if: ${{ always() && needs.setup_environment.outputs.IS_TEST_BUILD == 'true' }}
if: ${{ always() && needs.api_verification.outputs.IS_TEST_BUILD == 'true' }}
steps:
- name: Set success
# TEMP commented until things are working!
Expand All @@ -119,7 +114,7 @@ jobs:
gh api \
--method POST \
-H "Accept: application/vnd.github+json" \
/repos/$GITHUB_REPOSITORY/statuses/${{ needs.setup_environment.outputs.GIT_SHA }} \
/repos/$GITHUB_REPOSITORY/statuses/${{ needs.api_verification.outputs.GIT_SHA }} \
-f state="$RESULT" \
-f target_url="$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" \
-f description="$MSG" \
Expand Down

0 comments on commit 32bc9e7

Please sign in to comment.