From a0081c4023d2631bd512874b463a3561682554f9 Mon Sep 17 00:00:00 2001 From: Jacob Heider Date: Fri, 21 Apr 2023 17:19:52 -0400 Subject: [PATCH] allow for platform whitelist in yaml --- .github/workflows/bottle.yml | 9 ++++++++- .github/workflows/build.yml | 8 ++++++-- .github/workflows/new-version.yml | 1 + projects/freedesktop.org/libbsd/package.yml | 17 +++++------------ 4 files changed, 20 insertions(+), 15 deletions(-) diff --git a/.github/workflows/bottle.yml b/.github/workflows/bottle.yml index 53a2b806..662754ee 100644 --- a/.github/workflows/bottle.yml +++ b/.github/workflows/bottle.yml @@ -10,6 +10,9 @@ on: platform: required: true type: string + projects: + required: false + type: string outputs: pr: description: 'The PR number' @@ -21,14 +24,17 @@ jobs: outputs: os: ${{ steps.platform.outputs.os }} cache-set: ${{ steps.platform.outputs.cache-set }} + available: ${{ steps.platform.outputs.available }} steps: - uses: teaxyz/brewkit/actions/get-platform@v0 id: platform with: platform: ${{ inputs.platform }} + projects: ${{ inputs.projects }} bottle: needs: [get-platform] + if: ${{ needs.get-platform.outputs.available == 'true' }} runs-on: ${{ fromJson(needs.get-platform.outputs.os) }} outputs: srcs: ${{ env.srcs }} @@ -118,7 +124,8 @@ jobs: if-no-files-found: error upload: - needs: [bottle] + needs: [get-platform, bottle] + if: ${{ needs.get-platform.outputs.available == 'true' }} runs-on: ubuntu-latest steps: - uses: teaxyz/brewkit/actions/setup-brewkit@v0 diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c8a2b57a..5e8de9f6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,16 +19,19 @@ jobs: container: ${{ steps.platform.outputs.container }} test-matrix: ${{ steps.platform.outputs.test-matrix }} cache-set: ${{ steps.platform.outputs.cache-set }} + available: ${{ steps.platform.outputs.available }} steps: - uses: teaxyz/brewkit/actions/get-platform@v0 id: platform with: platform: ${{ inputs.platform }} + projects: ${{ inputs.projects }} build: runs-on: ${{ fromJson(needs.get-platform.outputs.build-os) }} container: ${{ fromJson(needs.get-platform.outputs.container) }} needs: [get-platform] + if: ${{ needs.get-platform.outputs.available == 'true' }} steps: - uses: actions/checkout@v3 @@ -90,6 +93,7 @@ jobs: test: needs: [get-platform, build] + if: ${{ needs.get-platform.outputs.available == 'true' }} runs-on: ${{ matrix.platform.os }} strategy: matrix: @@ -139,9 +143,9 @@ jobs: HAS_SECRETS: ${{ secrets.AWS_S3_CACHE != null }} stage: - needs: [test] + needs: [get-platform, test] # this only works for PRs from our team to our repo (security! :( ) - if: startsWith(github.ref, 'refs/pull/') && github.repository_owner == 'teaxyz' && needs.test.outputs.HAS_SECRETS == 'true' + if: startsWith(github.ref, 'refs/pull/') && github.repository_owner == 'teaxyz' && needs.test.outputs.HAS_SECRETS == 'true' && needs.get-platform.outputs.available == 'true' runs-on: ubuntu-latest steps: - uses: actions/download-artifact@v3 diff --git a/.github/workflows/new-version.yml b/.github/workflows/new-version.yml index b6079d17..1347392f 100644 --- a/.github/workflows/new-version.yml +++ b/.github/workflows/new-version.yml @@ -39,6 +39,7 @@ jobs: with: new-version: true platform: ${{ matrix.platform }} + projects: ${{ inputs.projects }} secrets: inherit complain: diff --git a/projects/freedesktop.org/libbsd/package.yml b/projects/freedesktop.org/libbsd/package.yml index 8af45901..c2cf4c0a 100644 --- a/projects/freedesktop.org/libbsd/package.yml +++ b/projects/freedesktop.org/libbsd/package.yml @@ -3,7 +3,9 @@ distributable: strip-components: 1 versions: - github: freedesktop/libbsd/tags + github: guillemj/libbsd/tags + +platform: linux build: dependencies: @@ -11,20 +13,11 @@ build: tea.xyz/gx/make: '*' hadrons.org/libmd: '*' script: | - if test "{{hw.platform}}" != "linux"; then - echo "libbsd is only supported on Linux" - mkdir -p "{{prefix}}" - touch {{prefix}}/linux-only - exit 0 - fi - ./configure --prefix={{prefix}} make --jobs {{hw.concurrency}} install test: dependencies: gnu.org/binutils: '*' - script: | - if test "{{hw.platform}}" = "linux"; then - nm {{prefix}}/lib/libbsd.so.{{version.major}} | grep strtonum - fi \ No newline at end of file + script: + nm {{prefix}}/lib/libbsd.so.{{version.major}} | grep strtonum \ No newline at end of file