From b551b85cdad22b8ab363347a3787baea74360af6 Mon Sep 17 00:00:00 2001 From: Cheng Shao <terrorjack@type.dance> Date: Sun, 6 Apr 2025 21:22:14 +0000 Subject: [PATCH] ci: test with google-chrome in nix jobs --- .gitlab-ci.yml | 12 +++++++----- tests/ghci.sh | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a96c6cf..852286c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -116,17 +116,17 @@ x86_64-linux-ubuntu-9.12: .nix: rules: - if: $UPSTREAM_GHC_FLAVOUR == null + variables: + NIXPKGS_ALLOW_UNFREE: "1" script: - | nix build --json --no-link $NIX_FLAKE_OUTPUTS - nix shell $NIX_BROWSERS .#all_9_12 --command ./tests/ghci.sh - nix shell $NIX_BROWSERS .#all_9_10 --command ./tests/ghci.sh + nix shell --impure $NIX_BROWSERS .#all_9_12 --command ./tests/ghci.sh + nix shell --impure $NIX_BROWSERS .#all_9_10 --command ./tests/ghci.sh .linux-nix: extends: .nix image: nixos/nix - variables: - NIX_BROWSERS: nixpkgs#firefox-bin before_script: - echo "experimental-features = nix-command flakes" >> /etc/nix/nix.conf - echo "cores = $CPUS" >> /etc/nix/nix.conf @@ -138,6 +138,7 @@ x86_64-linux-nix: - x86_64-linux variables: NIX_FLAKE_OUTPUTS: .#all_gmp .#all_native .#all_unreg .#all_9_12 .#all_9_10 .#all_9_8 .#all_9_6 + NIX_BROWSERS: nixpkgs#firefox-bin nixpkgs#google-chrome aarch64-linux-nix: extends: .linux-nix @@ -145,6 +146,7 @@ aarch64-linux-nix: - aarch64-linux variables: NIX_FLAKE_OUTPUTS: .#all_9_12 .#all_9_10 + NIX_BROWSERS: nixpkgs#firefox-bin aarch64-darwin-nix: extends: .nix @@ -152,7 +154,7 @@ aarch64-darwin-nix: - aarch64-darwin variables: NIX_FLAKE_OUTPUTS: .#all_9_12 .#all_9_10 - NIX_BROWSERS: "" + NIX_BROWSERS: nixpkgs#google-chrome .linux-ghcup: image: debian:12 diff --git a/tests/ghci.sh b/tests/ghci.sh index f60c87b..c067456 100755 --- a/tests/ghci.sh +++ b/tests/ghci.sh @@ -12,7 +12,7 @@ if [[ $FIREFOX_PATH != "" ]]; then echo -e "$GHCI_SCRIPT" | wasm32-wasi-ghc --interactive -fghci-browser -fghci-browser-puppeteer-launch-opts="{\"browser\":\"firefox\",\"executablePath\":\"$FIREFOX_PATH\"}" fi -CHROME_PATH=$(type -P google-chrome || type -P chromium || echo "") +CHROME_PATH=$(type -P google-chrome-stable || type -P chromium || echo "") if [[ $CHROME_PATH != "" ]]; then echo -e "$GHCI_SCRIPT" | wasm32-wasi-ghc --interactive -fghci-browser -fghci-browser-puppeteer-launch-opts="{\"browser\":\"chrome\",\"protocol\":\"webDriverBiDi\",\"executablePath\":\"$CHROME_PATH\",\"args\":[\"--no-sandbox\"]}" -- GitLab