From 3fd896cd4a966310cbef283aa974c6417fb34654 Mon Sep 17 00:00:00 2001
From: Andreas Kloeckner <inform@tiker.net>
Date: Mon, 17 Oct 2022 19:22:41 -0500
Subject: [PATCH] Revamp Firedrake action for direct checkout

---
 .github/workflows/ci.yml | 26 ++++++++++----------------
 1 file changed, 10 insertions(+), 16 deletions(-)

diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index f4c917b5d..a54f9b6e2 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -157,17 +157,18 @@ jobs:
         container:
             image: 'firedrakeproject/firedrake'
         steps:
-        -   name: "Fix permissions"
-            run: |
-                sudo mkdir -p /home/runner
-                sudo chown -R $(whoami) /home/runner || true
-                sudo chown -R $(whoami) /github/home || true
-                sudo chown -R $(whoami) /__w/loopy/ || true
-                sudo chown -R $(whoami) /__w/_temp/ || true
-        -   uses: mxschmitt/action-tmate@v3
-        -   uses: actions/checkout@v3
         -   name: "Main script"
             run: |
+                cd /home/firedrake
+                export HOME="$(pwd)"
+                mkdir loopy
+                cd loopy
+                git init
+
+                git remote add origin "https://github.com/$GITHUB_REPOSITORY.git"
+                git fetch origin "$GITHUB_REF"
+                git checkout FETCH_HEAD
+
                 git submodule update --init
 
                 . /home/firedrake/firedrake/bin/activate
@@ -185,11 +186,4 @@ jobs:
 
                 pytest --tb=native -rsxw --durations=10 -m 'not parallel' tests/multigrid/
 
-        -   name: "Prepare for tmate"
-            run: |
-                # helps with tmate debugging
-                sudo chmod a+rwX -R $(whoami) /__w/_temp || true
-
-        # -   uses: mxschmitt/action-tmate@v3
-
 # vim: sw=4
-- 
GitLab