From 50ac6ba15ae061d46cdca87418d24397df4493e6 Mon Sep 17 00:00:00 2001 From: Andrea Bedini Date: Tue, 22 Oct 2024 14:33:06 +0800 Subject: [PATCH] Test new upload-artifacts.yml --- .github/workflows/lints.yml | 9 +- .github/workflows/pipeline.yml | 58 ++++++------- .github/workflows/upload-artifacts.yml | 111 ++++++++++++------------- 3 files changed, 88 insertions(+), 90 deletions(-) diff --git a/.github/workflows/lints.yml b/.github/workflows/lints.yml index 92253a9531..fa948ce753 100644 --- a/.github/workflows/lints.yml +++ b/.github/workflows/lints.yml @@ -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) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index 282342b761..0172b422b3 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -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 @@ -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 @@ -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 @@ -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" @@ -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" @@ -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" @@ -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" @@ -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 diff --git a/.github/workflows/upload-artifacts.yml b/.github/workflows/upload-artifacts.yml index ddc923800f..2a1fc60ffe 100644 --- a/.github/workflows/upload-artifacts.yml +++ b/.github/workflows/upload-artifacts.yml @@ -1,85 +1,44 @@ -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 'no-reply@iohk.io' - - - 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 < 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 +