Skip to content

Commit

Permalink
Remove reliance on GHA target matrix in nightly builds (#87)
Browse files Browse the repository at this point in the history
This mimics the change from edgedb/edgedb. It makes builds faster and more concurrent.
  • Loading branch information
ambv authored Jul 10, 2020
1 parent 96650aa commit 8ede7c4
Show file tree
Hide file tree
Showing 2 changed files with 362 additions and 276 deletions.
140 changes: 53 additions & 87 deletions .github/workflows.src/nightly.tpl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,59 +10,34 @@ on:
- nightly

jobs:
<% if targets.linux %>
build-linux:
<% for tgt in targets.linux %>
build-<< tgt.name >>:
runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
target: [<% for tgt in targets.linux %>
<< tgt.name >>,<% endfor %>
]
include:<% for tgt in targets.linux %>
- target: << tgt.name >>
platform: << tgt.platform >>
platform_version: << tgt.platform_version >><% endfor %>

steps:
<% for tgt in targets.linux %>
- name: Build (${{ matrix.target }})
- name: Build
uses: edgedb/edgedb-pkg/integration/linux/build/<< tgt.platform >><< "-{}".format(tgt.platform_version) if tgt.platform_version >>@master
if: matrix.target == '<< tgt.name >>'
env:
PKG_REVISION: "<current-date>"
PKG_SUBDIST: "nightly"
PKG_PLATFORM: "${{ matrix.platform }}"
PKG_PLATFORM_VERSION: "${{ matrix.platform_version }}"
PKG_PLATFORM: "<< tgt.platform >>"
PKG_PLATFORM_VERSION: "<< tgt.platform_version >>"
PACKAGE: edgedbpkg.edgedbcli:EdgeDBCLI
EXTRA_OPTIMIZATIONS: "true"
<% if tgt.family == "generic" %>
BUILD_GENERIC: true
<% endif %>
<% endfor %>

- uses: actions/upload-artifact@v1
with:
name: builds-${{ matrix.target }}
path: artifacts/${{ matrix.target }}
<% endif %>

<% if targets.macos %>
build-macos:
name: builds-<< tgt.name >>
path: artifacts/<< tgt.name >>
<% endfor %>
<% for tgt in targets.macos %>
build-<< tgt.name >>:
runs-on: macos-latest
continue-on-error: true

strategy:
max-parallel: 4
matrix:
target: [<% for tgt in targets.macos %>
<< tgt.name >>,<% endfor %>
]
include:<% for tgt in targets.macos %>
- target: << tgt.name >>
platform: << tgt.platform >>
platform_version: << tgt.platform_version >><% endfor %>

steps:
- uses: actions/checkout@v1
with:
Expand Down Expand Up @@ -99,13 +74,12 @@ jobs:
/Library/Developer/CommandLineTools/SDKs/MacOSX10.10.sdk/
sudo xcode-select -s /Library/Developer/CommandLineTools
<% for tgt in targets.macos %>
- name: Build (${{ matrix.target }})
- name: Build
env:
PKG_REVISION: "<current-date>"
PKG_SUBDIST: "nightly"
PKG_PLATFORM: "${{ matrix.platform }}"
PKG_PLATFORM_VERSION: "${{ matrix.platform_version }}"
PKG_PLATFORM: "<< tgt.platform >>"
PKG_PLATFORM_VERSION: "<< tgt.platform_version >>"
SDKROOT: /Library/Developer/CommandLineTools/SDKs/MacOSX10.10.sdk/
PACKAGE: edgedbpkg.edgedbcli:EdgeDBCLI
<% if tgt.family == "generic" %>
Expand All @@ -114,82 +88,74 @@ jobs:
run: |
xcrun --show-sdk-path
edgedb-pkg/integration/macos/build.sh
<% endfor %>
- uses: actions/upload-artifact@v1
with:
name: builds-${{ matrix.target }}
path: artifacts/${{ matrix.target }}
<% endif %>

<% if targets.linux %>
publish-linux:
needs: [build-linux]
name: builds-<< tgt.name >>
path: artifacts/<< tgt.name >>
<% endfor %>
<% for tgt in targets.linux %>
publish-<< tgt.name >>:
needs: [build-<< tgt.name >>]
runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
target: [<% for tgt in targets.linux %>
<< tgt.name >>,<% endfor %>
]
include:<% for tgt in targets.linux %>
- target: << tgt.name >>
platform: << tgt.platform >>
platform_version: << tgt.platform_version >><% endfor %>

steps:
- uses: actions/download-artifact@v1
with:
name: builds-${{ matrix.target }}
path: artifacts/${{ matrix.target }}
name: builds-<< tgt.name >>
path: artifacts/<< tgt.name >>

<% for tgt in targets.linux %>
- name: Publish (${{ matrix.target }})
- name: Describe
id: describe
uses: edgedb/edgedb-pkg/integration/actions/describe-artifact@master
with:
target: << tgt.name >>

- name: Publish
uses: edgedb/edgedb-pkg/integration/linux/upload/<< tgt.platform >><< "-{}".format(tgt.platform_version) if tgt.platform_version >>@master
if: matrix.target == '<< tgt.name >>'
env:
PKG_SUBDIST: "nightly"
PKG_PLATFORM: "${{ matrix.platform }}"
PKG_PLATFORM_VERSION: "${{ matrix.platform_version }}"
PKG_PLATFORM: "<< tgt.platform >>"
PKG_PLATFORM_VERSION: "<< tgt.platform_version >>"
PKG_VERSION_SLOT: "${{ steps.describe.outputs.version-slot }}"
PACKAGE_UPLOAD_SSH_KEY: "${{ secrets.PACKAGE_UPLOAD_SSH_KEY }}"
<% endfor %>
<% endif %>

<% if targets.macos %>
publish-macos:
needs: [build-macos]
- uses: actions/checkout@v1
with:
repository: edgedb/edgedb-docker
ref: master
path: edgedb/dockerfile
<% endfor %>
<% for tgt in targets.macos %>
publish-<< tgt.name >>:
needs: [build-<< tgt.name >>]
runs-on: macos-latest
strategy:
max-parallel: 4
matrix:
target: [<% for tgt in targets.macos %>
<< tgt.name >>,<% endfor %>
]
include:<% for tgt in targets.macos %>
- target: << tgt.name >>
platform: << tgt.platform >>
platform_version: << tgt.platform_version >><% endfor %>

steps:
- uses: actions/download-artifact@v1
with:
name: builds-${{ matrix.target }}
path: artifacts/${{ matrix.target }}
name: builds-<< tgt.name >>
path: artifacts/<< tgt.name >>

- uses: actions/checkout@v1
with:
repository: edgedb/edgedb-pkg
ref: master
path: edgedb-cli/edgedb-pkg

<% for tgt in targets.macos %>
- name: Publish (${{ matrix.target }})
- name: Describe
id: describe
uses: edgedb/edgedb-pkg/integration/actions/describe-artifact@master
with:
target: << tgt.name >>

- name: Publish
env:
PKG_SUBDIST: "nightly"
PKG_PLATFORM: "${{ matrix.platform }}"
PKG_PLATFORM_VERSION: "${{ matrix.platform_version }}"
PKG_PLATFORM: "<< tgt.platform >>"
PKG_PLATFORM_VERSION: "<< tgt.platform_version >>"
PKG_VERSION_SLOT: "${{ steps.describe.outputs.version-slot }}"
PACKAGE_UPLOAD_SSH_KEY: "${{ secrets.PACKAGE_UPLOAD_SSH_KEY }}"
run: |
edgedb-pkg/integration/macos/publish.sh
<% endfor %>

<% endif %>
Loading

0 comments on commit 8ede7c4

Please sign in to comment.