Skip to content

Commit

Permalink
Test new upload-artifacts.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
andreabedini committed Oct 22, 2024
1 parent e57d373 commit 50ac6ba
Show file tree
Hide file tree
Showing 3 changed files with 88 additions and 90 deletions.
9 changes: 8 additions & 1 deletion .github/workflows/lints.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,16 @@ env:

jobs:
deadnix:
runs-on: [self-hosted, linux]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Nix with good defaults
uses: input-output-hk/install-nix-action@v20
with:
extra_nix_config: |
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= loony-tools:pr9m4BkM/5/eSTZlkQyRt57Jz7OMBxNSUiMC4FkcNfk=
substituters = https://cache.nixos.org/ https://cache.iog.io/ https://cache.zw3rk.com
nix_path: nixpkgs=channel:nixos-unstable
- run: |
nix run github:astro/deadnix -- --edit --no-lambda-pattern-names --exclude materialized
TMPFILE=$(mktemp)
Expand Down
58 changes: 29 additions & 29 deletions .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,126 +19,126 @@ env:

jobs:
nix-build:
runs-on: [self-hosted, linux]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: "Run tests with ghc8107: Running the nix-build tests..."
run: "./test/tests.sh ghc8107 nix-build"

unit-tests:
runs-on: [self-hosted, linux]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: "Run tests with ghc8107: Running the unit tests..."
run: "./test/tests.sh ghc8107 unit-tests"

runghc:
runs-on: [self-hosted, linux]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: "Run tests with ghc8107: Checking that a nix-shell works for runghc..."
run: "./test/tests.sh ghc8107 runghc"

cabal:
runs-on: [self-hosted, linux]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: "Run tests with ghc8107: Checking that a nix-shell works for cabal..."
run: "./test/tests.sh ghc8107 cabal"

cabal-doExactConfig:
runs-on: [self-hosted, linux]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: "Run tests with ghc8107: Checking that a nix-shell works for cabal (doExactConfig component)..."
run: "./test/tests.sh ghc8107 cabal-doExactConfig"

tests-benchmarks:
runs-on: [self-hosted, linux]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: "Run tests with ghc8107: Checking that a nix-shell works for a project with test-suite build-tools and benchmarks..."
run: "./test/tests.sh ghc8107 tests-benchmarks"

multi-target:
runs-on: [self-hosted, linux]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: "Run tests with ghc8107: Checking that a nix-shell works for a multi-target project..."
run: "./test/tests.sh ghc8107 multi-target"

shellFor-single-package:
runs-on: [self-hosted, linux]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: "Run tests with ghc8107: Checking shellFor works for a cabal project, multiple packages..."
run: "./test/tests.sh ghc8107 shellFor-single-package"

shellFor-multiple-package:
runs-on: [self-hosted, linux]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: "Run tests with ghc8107: Checking shellFor works for a cabal project, single package...y"
run: "./test/tests.sh ghc8107 shellFor-multiple-package"

shellFor-hoogle:
runs-on: [self-hosted, linux]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: "Run tests with ghc8107: Checking shellFor works for a cabal project, single package..."
run: "./test/tests.sh ghc8107 shellFor-hoogle"

shellFor-not-depends:
runs-on: [self-hosted, linux]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: "Run tests with ghc8107: Checking shellFor does not depend on given packages...y"
run: "./test/tests.sh ghc8107 shellFor-not-depends"

maintainer-scripts:
runs-on: [self-hosted, linux]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: "Run tests with ghc8107: Checking the maintainer scripts...y"
run: "./test/tests.sh ghc8107 maintainer-scripts"

plan-extra-hackages:
runs-on: [self-hosted, linux]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: "Run tests with ghc8107: Checking that plan construction works with extra Hackages..."
run: "./test/tests.sh ghc8107 plan-extra-hackages"

build-extra-hackages:
runs-on: [self-hosted, linux]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: "Run tests with ghc8107: Checking that package with extra Hackages can be build..."
run: "./test/tests.sh ghc8107 build-extra-hackages"

hix:
runs-on: [self-hosted, linux]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: "Run tests with ghc8107: End-2-end test of hix project initialization and flakes development shell ..."
run: "./test/tests.sh ghc8107 hix"

# template:
# runs-on: [self-hosted, linux]
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - name: "Run tests with ghc8107: End-2-end test of hix project initialization and flakes development shell ..."
# run: "./test/tests.sh ghc8107 template"

docs:
runs-on: [self-hosted, linux]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: "Test examples in documentation ..."
run: "./test/tests.sh ghc8107 docs"

hydra-ifdLevel-0-and-1:
runs-on: [self-hosted, linux]
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
Expand All @@ -152,7 +152,7 @@ jobs:
./check-hydra.sh
hydra-ifdLevel-2:
runs-on: [self-hosted, linux]
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
Expand All @@ -164,7 +164,7 @@ jobs:
./check-hydra.sh
hydra-ifdLevel-3:
runs-on: [self-hosted, linux]
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
Expand All @@ -175,7 +175,7 @@ jobs:
./check-hydra.sh
closure-size:
runs-on: [self-hosted, linux]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: "Check closure size with ghc8107"
Expand All @@ -185,7 +185,7 @@ jobs:
./check-closure-size.sh
update-docs:
runs-on: [self-hosted, linux]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: "Update docs"
Expand All @@ -194,7 +194,7 @@ jobs:
./update-docs.sh
check-materialization-concurrency:
runs-on: [self-hosted, linux]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: "Make sure materialize function does not limit concurrency"
Expand All @@ -203,7 +203,7 @@ jobs:
./check-materialization-concurrency.sh
check-path-support:
runs-on: [self-hosted, linux]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: "Make sure non store paths like can be used as src"
Expand All @@ -212,35 +212,35 @@ jobs:
./check-path-support.sh
haskell-nix-roots-do-not-require-IFDs:
runs-on: [self-hosted, linux]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: "Check that the haskell.nix roots do not require IFDs"
run: nix build .#roots.x86_64-linux --accept-flake-config --option allow-import-from-derivation false

hydra-without-remote-builders-ghc8107:
runs-on: [self-hosted, linux]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: "Check that evaluation of hydra jobs works without using remote builders for GHC 8.10.7"
run: nix path-info --derivation .#requiredJobs.x86_64-darwin.required-unstable-ghc8107-native --show-trace --builders ''

hydra-without-remote-builders-ghc9101:
runs-on: [self-hosted, linux]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: "Check that evaluation of hydra jobs works without using remote builders for GHC 9.10.1"
run: nix path-info --derivation .#requiredJobs.x86_64-darwin.required-unstable-ghc9101-native --show-trace --builders ''

hix-cabal:
runs-on: [self-hosted, linux]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: "Check hix -- run github:haskell/cabal/3.10#cabal-install:exe:cabal -- --version"
run: "HIX_DIR=$(mktemp -d) nix run .#hix --accept-flake-config -- run github:haskell/cabal/3.10#cabal-install:exe:cabal --accept-flake-config --override-input haskellNix . -- --version"

nix-tools:
runs-on: [self-hosted, linux]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: nix build ./nix-tools#checks.x86_64-linux.truncate-index --accept-flake-config
111 changes: 51 additions & 60 deletions .github/workflows/upload-artifacts.yml
Original file line number Diff line number Diff line change
@@ -1,89 +1,80 @@
name: Wait for Hydra Build

on:
push:
branches:
- main
tags:
- "nix-tools-*"
pull_request:
check_suite:
types:
- completed

env:
FLAKE_REF: github:${{ github.repository }}?ref=${{ github.head_ref || github.ref }}
FLAKE_REF: github:${{ github.repository }}/${{ github.sha }}
GH_TOKEN: ${{ github.token }}

jobs:
wait-for-hydra:
upload-artifacts:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install Nix with good defaults
uses: input-output-hk/install-nix-action@v20
with:
extra_nix_config: |
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= loony-tools:pr9m4BkM/5/eSTZlkQyRt57Jz7OMBxNSUiMC4FkcNfk=
substituters = https://cache.nixos.org/ https://cache.iog.io/ https://cache.zw3rk.com
# Any derivation should already have been built on Hydra, do not build anything here
builders =
max-jobs = 0
nix_path: nixpkgs=channel:nixos-unstable

- name: Display flake metadata
id: flake-metadata
run: |
echo $PWD
ls -lah .
nix flake metadata ${{ env.FLAKE_REF }}
nix flake metadata ${{ env.FLAKE_REF }} --json | jq -r '"LOCKED_URL=\(.url)"' >> "$GITHUB_OUTPUT"
- name: Wait for nix-tools meta job
uses: input-output-hk/actions/wait-for-hydra@angerman/support-prs
with:
status: 'ci/hydra-build:nix-tools'
run: nix flake metadata ${{ env.FLAKE_REF }}

- name: "Pull nix-tools"
run: |
ls -lah .
cp $(nix build --builders "" --max-jobs 0 ${{ steps.flake-metadata.outputs.LOCKED_URL }}#hydraJobs.aarch64-darwin.nix-tools.static.zipped.nix-tools-static-no-ifd --no-link --print-out-paths)/*.zip .
cp $(nix build --builders "" --max-jobs 0 ${{ steps.flake-metadata.outputs.LOCKED_URL }}#hydraJobs.x86_64-darwin.nix-tools.static.zipped.nix-tools-static-no-ifd --no-link --print-out-paths)/*.zip .
cp $(nix build --builders "" --max-jobs 0 ${{ steps.flake-metadata.outputs.LOCKED_URL }}#hydraJobs.x86_64-linux.nix-tools.static.zipped.nix-tools-static-no-ifd --no-link --print-out-paths)/*.zip .
cp $(nix build --builders "" --max-jobs 0 ${{ steps.flake-metadata.outputs.LOCKED_URL }}#hydraJobs.x86_64-linux.nix-tools.static.zipped.nix-tools-static-arm64-no-ifd --no-link --print-out-paths)/*.zip .
- name: Configure Git
if: startsWith(github.ref, 'refs/tags/')
run: |
git config --global user.name 'Auto Update Bot'
git config --global user.email '[email protected]'
- name: "Compute nix-tools-static.nix"
if: startsWith(github.ref, 'refs/tags/')
run: |
git fetch --all
git switch --force static-nix-tools
(
echo "pkgs: let baseurl = \"https://github.com/input-output-hk/haskell.nix/releases/download/${GITHUB_REF_NAME}/\"; in {"
for arch in aarch64-darwin x86_64-darwin aarch64-linux x86_64-linux; do
echo " ${arch} = pkgs.fetchurl { "
echo " name = \"${arch}-nix-tools-static\";"
echo " url = \"\${baseurl}${arch}-nix-tools-static.zip\";"
echo " sha256 = \"$(nix-hash --sri --type sha256 --flat ${arch}-nix-tools-static.zip)\";"
echo " };"
done
echo "}"
) > nix-tools-static.nix
cat nix-tools-static.nix
- name: Push to nix branch
if: startsWith(github.ref, 'refs/tags/')
run: |
git add nix-tools-static.nix
git commit -m "update nix-tools-static.nix"
git push origin static-nix-tools
mapfile -t attrs <<EOF
hydraJobs.aarch64-darwin.nix-tools.static.zipped.nix-tools-static-no-ifd
hydraJobs.x86_64-darwin.nix-tools.static.zipped.nix-tools-static-no-ifd
hydraJobs.x86_64-linux.nix-tools.static.zipped.nix-tools-static-no-ifd
hydraJobs.x86_64-linux.nix-tools.static.zipped.nix-tools-static-arm64-no-ifd
EOF
for attr in $attrs; do
OUT=$(nix build --no-link --print-out-paths "$FLAKE_REF#$attr")
cp -v "$OUT/*.zip" .
done
- name: Release
uses: input-output-hk/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
*-nix-tools-static.zip
# - name: Configure Git
# if: startsWith(github.ref, 'refs/tags/')
# run: |
# git config --global user.name 'Auto Update Bot'
# git config --global user.email '[email protected]'

# - name: "Compute nix-tools-static.nix"
# if: startsWith(github.ref, 'refs/tags/')
# run: |
# git fetch --all
# git switch --force static-nix-tools
# (
# echo "pkgs: let baseurl = \"https://github.com/input-output-hk/haskell.nix/releases/download/${GITHUB_REF_NAME}/\"; in {"
# for arch in aarch64-darwin x86_64-darwin aarch64-linux x86_64-linux; do
# echo " ${arch} = pkgs.fetchurl { "
# echo " name = \"${arch}-nix-tools-static\";"
# echo " url = \"\${baseurl}${arch}-nix-tools-static.zip\";"
# echo " sha256 = \"$(nix-hash --sri --type sha256 --flat ${arch}-nix-tools-static.zip)\";"
# echo " };"
# done
# echo "}"
# ) > nix-tools-static.nix
# cat nix-tools-static.nix
#
# - name: Push to nix branch
# if: startsWith(github.ref, 'refs/tags/')
# run: |
# git add nix-tools-static.nix
# git commit -m "update nix-tools-static.nix"
# git push origin static-nix-tools

0 comments on commit 50ac6ba

Please sign in to comment.