From ea858b7f010962a513e07b246c324daec2467981 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mickae=CC=88l=20Menu?= Date: Fri, 24 Sep 2021 17:06:08 +0200 Subject: [PATCH 1/2] Optimize GitHub workflows --- .../workflows/{navigator.yml => build.yml} | 8 +++--- .github/workflows/lcp.yml | 26 ------------------- .github/workflows/opds.yml | 26 ------------------- .github/workflows/shared.yml | 26 ------------------- .github/workflows/streamer.yml | 26 ------------------- .github/workflows/test-app.yml | 24 ----------------- 6 files changed, 3 insertions(+), 133 deletions(-) rename .github/workflows/{navigator.yml => build.yml} (86%) delete mode 100644 .github/workflows/lcp.yml delete mode 100644 .github/workflows/opds.yml delete mode 100644 .github/workflows/shared.yml delete mode 100644 .github/workflows/streamer.yml delete mode 100644 .github/workflows/test-app.yml diff --git a/.github/workflows/navigator.yml b/.github/workflows/build.yml similarity index 86% rename from .github/workflows/navigator.yml rename to .github/workflows/build.yml index b217d56694..78c5e7fd9e 100644 --- a/.github/workflows/navigator.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,4 @@ -name: Navigator +name: Checks on: push: @@ -21,9 +21,9 @@ jobs: java-version: '11' distribution: 'adopt' - name: Build - run: ./gradlew clean :readium:navigator:build -x test + run: ./gradlew clean build -x test - name: Test - run: ./gradlew :readium:navigator:test --continue + run: ./gradlew test --continue lint: name: Lint @@ -37,8 +37,6 @@ jobs: steps: - name: Checkout uses: actions/checkout@v2 - with: - lfs: 'true' - name: Install dependencies run: npm install --prefix "$scripts" - name: Lint JavaScript diff --git a/.github/workflows/lcp.yml b/.github/workflows/lcp.yml deleted file mode 100644 index ea417b8604..0000000000 --- a/.github/workflows/lcp.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: LCP - -on: - push: - branches: [ main, develop ] - pull_request: - -jobs: - build: - name: Build and test - runs-on: ubuntu-latest - - steps: - - name: Checkout - uses: actions/checkout@v2 - with: - lfs: 'true' - - name: Set up JDK 11 - uses: actions/setup-java@v2 - with: - java-version: '11' - distribution: 'adopt' - - name: Build - run: ./gradlew clean :readium:lcp:build -x test - - name: Test - run: ./gradlew :readium:lcp:test --continue diff --git a/.github/workflows/opds.yml b/.github/workflows/opds.yml deleted file mode 100644 index b4cd85f0f0..0000000000 --- a/.github/workflows/opds.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: OPDS - -on: - push: - branches: [ main, develop ] - pull_request: - -jobs: - build: - name: Build and test - runs-on: ubuntu-latest - - steps: - - name: Checkout - uses: actions/checkout@v2 - with: - lfs: 'true' - - name: Set up JDK 11 - uses: actions/setup-java@v2 - with: - java-version: '11' - distribution: 'adopt' - - name: Build - run: ./gradlew clean :readium:opds:build -x test - - name: Test - run: ./gradlew :readium:opds:test --continue diff --git a/.github/workflows/shared.yml b/.github/workflows/shared.yml deleted file mode 100644 index 5a72315886..0000000000 --- a/.github/workflows/shared.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: Shared - -on: - push: - branches: [ main, develop ] - pull_request: - -jobs: - build: - name: Build and test - runs-on: ubuntu-latest - - steps: - - name: Checkout - uses: actions/checkout@v2 - with: - lfs: 'true' - - name: Set up JDK 11 - uses: actions/setup-java@v2 - with: - java-version: '11' - distribution: 'adopt' - - name: Build - run: ./gradlew clean :readium:shared:build -x test - - name: Test - run: ./gradlew :readium:shared:test --continue diff --git a/.github/workflows/streamer.yml b/.github/workflows/streamer.yml deleted file mode 100644 index 9ada33caf4..0000000000 --- a/.github/workflows/streamer.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: Streamer - -on: - push: - branches: [ main, develop ] - pull_request: - -jobs: - build: - name: Build and test - runs-on: ubuntu-latest - - steps: - - name: Checkout - uses: actions/checkout@v2 - with: - lfs: 'true' - - name: Set up JDK 11 - uses: actions/setup-java@v2 - with: - java-version: '11' - distribution: 'adopt' - - name: Build - run: ./gradlew clean :readium:streamer:build -x test - - name: Test - run: ./gradlew :readium:streamer:test --continue diff --git a/.github/workflows/test-app.yml b/.github/workflows/test-app.yml deleted file mode 100644 index 388850d9fb..0000000000 --- a/.github/workflows/test-app.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: Test App - -on: - push: - branches: [ main, develop ] - pull_request: - -jobs: - build: - name: Build - runs-on: ubuntu-latest - - steps: - - name: Checkout - uses: actions/checkout@v2 - with: - lfs: 'true' - - name: Set up JDK 11 - uses: actions/setup-java@v2 - with: - java-version: '11' - distribution: 'adopt' - - name: Build - run: ./gradlew clean :test-app:build From 74dd40c0377de7244e3dbd0c11a28d3c9bc6654c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mickae=CC=88l=20Menu?= Date: Fri, 24 Sep 2021 17:22:29 +0200 Subject: [PATCH 2/2] Cache Git LFS --- .github/workflows/{build.yml => checks.yml} | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) rename .github/workflows/{build.yml => checks.yml} (74%) diff --git a/.github/workflows/build.yml b/.github/workflows/checks.yml similarity index 74% rename from .github/workflows/build.yml rename to .github/workflows/checks.yml index 78c5e7fd9e..b7c642aa59 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/checks.yml @@ -13,13 +13,25 @@ jobs: steps: - name: Checkout uses: actions/checkout@v2 + + # See https://github.com/actions/checkout/issues/165 + - name: Create LFS file list + run: git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id + - name: Restore LFS cache + uses: actions/cache@v2 + id: lfs-cache with: - lfs: 'true' + path: .git/lfs + key: lfs-${{ hashFiles('.lfs-assets-id') }}-v1 + - name: Git LFS Pull + run: git lfs pull + - name: Set up JDK 11 uses: actions/setup-java@v2 with: java-version: '11' distribution: 'adopt' + - name: Build run: ./gradlew clean build -x test - name: Test