From 96118b7ef747995c5016ce447992ebb46dd14813 Mon Sep 17 00:00:00 2001 From: Guillaume Martres Date: Wed, 24 Mar 2021 13:24:55 +0100 Subject: [PATCH] CI: sync/deinit submodules before running actions/checkout This action runs "git submodule foreach" early which will fail if a submodule has been deleted but is still present in the repo (see https://github.com/actions/checkout/issues/354). --- .github/workflows/ci.yaml | 42 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 73c33373c6b0..c8cdaab91075 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -52,6 +52,9 @@ jobs: - name: Set JDK 16 as default run: echo "/usr/lib/jvm/java-16-openjdk-amd64/bin" >> $GITHUB_PATH + - name: Cleanup submodules + run: git reset --hard HEAD && git submodule sync && git submodule deinit -f . || true + - name: Checkout cleanup script uses: actions/checkout@v2 @@ -97,6 +100,9 @@ jobs: - name: Set JDK 16 as default run: echo "/usr/lib/jvm/java-16-openjdk-amd64/bin" >> $GITHUB_PATH + - name: Cleanup submodules + run: git reset --hard HEAD && git submodule sync && git submodule deinit -f . || true + - name: Checkout cleanup script uses: actions/checkout@v2 @@ -132,6 +138,9 @@ jobs: )" steps: + - name: Cleanup submodules + run: git reset --hard HEAD && git submodule sync && git submodule deinit -f . || true + - name: Git Checkout uses: actions/checkout@v2 @@ -157,6 +166,9 @@ jobs: )" steps: + - name: Cleanup submodules + run: git reset --hard HEAD && git submodule sync && git submodule deinit -f . || true + - name: Git Checkout uses: actions/checkout@v2 @@ -190,6 +202,9 @@ jobs: )" steps: + - name: Cleanup submodules + run: git reset --hard HEAD && git submodule sync && git submodule deinit -f . || true + - name: Checkout cleanup script uses: actions/checkout@v2 @@ -230,6 +245,9 @@ jobs: )" steps: + - name: Cleanup submodules + run: git reset --hard HEAD && git submodule sync && git submodule deinit -f . || true + - name: Checkout cleanup script uses: actions/checkout@v2 @@ -270,6 +288,9 @@ jobs: )" steps: + - name: Cleanup submodules + run: git reset --hard HEAD && git submodule sync && git submodule deinit -f . || true + - name: Checkout cleanup script uses: actions/checkout@v2 @@ -310,6 +331,9 @@ jobs: )" steps: + - name: Cleanup submodules + run: git reset --hard HEAD && git submodule sync && git submodule deinit -f . || true + - name: Checkout cleanup script uses: actions/checkout@v2 @@ -358,6 +382,9 @@ jobs: - name: Set JDK 8 as default run: echo "/usr/lib/jvm/java-8-openjdk-amd64/bin" >> $GITHUB_PATH + - name: Cleanup submodules + run: git reset --hard HEAD && git submodule sync && git submodule deinit -f . || true + - name: Checkout cleanup script uses: actions/checkout@v2 @@ -394,6 +421,9 @@ jobs: SONATYPE_USER: ${{ secrets.SONATYPE_USER_ORGSCALALANG }} steps: + - name: Cleanup submodules + run: git reset --hard HEAD && git submodule sync && git submodule deinit -f . || true + - name: Checkout cleanup script uses: actions/checkout@v2 @@ -428,6 +458,9 @@ jobs: # Make sure you have the write permissions to the repo: https://github.com/lampepfl/dotty-website steps: + - name: Cleanup submodules + run: git reset --hard HEAD && git submodule sync && git submodule deinit -f . || true + - name: Checkout cleanup script uses: actions/checkout@v2 @@ -474,6 +507,9 @@ jobs: SONATYPE_USER: ${{ secrets.SONATYPE_USER_ORGSCALALANG }} steps: + - name: Cleanup submodules + run: git reset --hard HEAD && git submodule sync && git submodule deinit -f . || true + - name: Checkout cleanup script uses: actions/checkout@v2 @@ -556,6 +592,9 @@ jobs: # Make sure you have the write permissions to the repo: https://github.com/lampepfl/dotty-website steps: + - name: Cleanup submodules + run: git reset --hard HEAD && git submodule sync && git submodule deinit -f . || true + - name: Checkout cleanup script uses: actions/checkout@v2 @@ -601,6 +640,9 @@ jobs: SONATYPE_USER: ${{ secrets.SONATYPE_USER }} steps: + - name: Cleanup submodules + run: git reset --hard HEAD && git submodule sync && git submodule deinit -f . || true + - name: Checkout cleanup script uses: actions/checkout@v2