Skip to content

Commit

Permalink
Merge pull request #1243 from input-output-hk/merge-github-workflows
Browse files Browse the repository at this point in the history
Merge binary producing github action workflows
  • Loading branch information
ch1bo authored Jan 10, 2024
2 parents 4f5f841 + 53a6876 commit 9805b33
Show file tree
Hide file tree
Showing 5 changed files with 91 additions and 105 deletions.
52 changes: 0 additions & 52 deletions .github/workflows/binaries-linux.yaml

This file was deleted.

52 changes: 0 additions & 52 deletions .github/workflows/binaries-macos.yaml

This file was deleted.

86 changes: 86 additions & 0 deletions .github/workflows/binaries.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# Build distributable executables for hydra
name: Binaries

on:
push:
branches:
- "**"
tags:
- "*.*.*"

jobs:
# Produces static ELF binary for using MuslC which includes all needed
# libraries statically linked into it.
build-executables-linux:
name: "Build x86_64-linux static executables"
runs-on: ubuntu-latest
steps:
- name: 📥 Checkout repository
uses: actions/checkout@v4
with:
# Also ensure we have all history with all tags
fetch-depth: 0

- name: ❄ Prepare nix
uses: cachix/install-nix-action@v23
with:
extra_nix_config: |
accept-flake-config = true
log-lines = 1000
- name: ❄ Cachix cache of nix derivations
uses: cachix/cachix-action@v13
with:
name: cardano-scaling
authToken: '${{ secrets.CACHIX_CARDANO_SCALING_AUTH_TOKEN }}'

- name: ❄ Build static executables
run: |
nix build .#release-static
# XXX: Why unzip https://github.com/actions/upload-artifact/issues/39
echo "VERSION=$(git describe --always ${{ github.ref }})" >> "$GITHUB_ENV"
unzip result/*.zip -d out
- name: 💾 Upload executables
uses: actions/upload-artifact@v4
with:
name: hydra-x86_64-linux-${{ env.VERSION }} # automatically zips
path: out/*

# Produces a dynamic Mach-O binary which is still dynamically linked against
# system dependencies, but all third-party libraries are statically linked.
build-executables-macos:
name: "Build aarch64-darwin dynamic executables"
runs-on: [self-hosted, macOS, ARM64]
steps:
- name: 📥 Checkout repository
uses: actions/checkout@v4
with:
# Also ensure we have all history with all tags
fetch-depth: 0

- name: ❄ Prepare nix
uses: cachix/install-nix-action@v23
with:
extra_nix_config: |
accept-flake-config = true
log-lines = 1000
- name: ❄ Cachix cache of nix derivations
uses: cachix/cachix-action@v13
with:
name: cardano-scaling
authToken: '${{ secrets.CACHIX_CARDANO_SCALING_AUTH_TOKEN }}'

- name: ❄ Build executables
run: |
nix build .#release
# XXX: Why unzip https://github.com/actions/upload-artifact/issues/39
echo "VERSION=$(git describe --always ${{ github.ref }})" >> "$GITHUB_ENV"
unzip result/*.zip -d out
- name: 💾 Upload executables
uses: actions/upload-artifact@v4
with:
name: hydra-aarch64-darwin-${{ env.VERSION }} # automatically zips
path: out/*
5 changes: 4 additions & 1 deletion .github/workflows/ci-nix.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ jobs:
path: |
./**/test-results.xml
./**/hspec-results.md
if-no-files-found: ignore

# NOTE: This depends on the path used in hydra-cluster e2e tests
- name: 💾 Upload logs
Expand All @@ -78,6 +79,7 @@ jobs:
with:
name: hydra-cluster-e2e-test-logs
path: /tmp/nix-shell.*/hydra-cluster-e2e-*/logs/*
if-no-files-found: ignore

publish-test-results:
name: Publish test results
Expand Down Expand Up @@ -181,6 +183,7 @@ jobs:
with:
name: hydra-cluster-bench-logs
path: /tmp/nix-shell.*/bench-*/**/*.log
if-no-files-found: ignore

publish-benchmark-results:
name: Publish benchmark results
Expand All @@ -204,7 +207,7 @@ jobs:
body="${body//'%'/'%25'}"
body="${body//$'\n'/'%0A'}"
body="${body//$'\r'/'%0D'}"
echo "::set-output name=body::$body"
echo "body=$body" >> "$GITHUB_OUTPUT"
- name: 🔎 Find Comment
uses: peter-evans/find-comment@v2
id: find-comment
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/smoke-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,4 @@ jobs:
with:
name: hydra-cluster-logs
path: ${state_dir}/logs/**/*
if-no-files-found: ignore

0 comments on commit 9805b33

Please sign in to comment.