Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize CI a bit #2773

Merged
merged 9 commits into from
Mar 13, 2022
Merged
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 25 additions & 58 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
name: CI
env:
BINARY_PATH: brut.apktool/apktool-lib/src/main/resources/prebuilt
on:
push:
branches:
Expand All @@ -12,49 +10,43 @@ on:
- 'brut.apktool/apktool-lib/src/main/resources/**'
- '.github/workflows/**'

env:
BINARY_PATH: brut.apktool/apktool-lib/src/main/resources/prebuilt

jobs:
analyze-mac-aapt:
runs-on: macos-latest
strategy:
matrix:
file: [aapt_64, aapt2_64]

file: [ aapt_64, aapt2_64 ]
steps:
- uses: actions/checkout@v2

- uses: actions/checkout@v3
- name: Verify Executable
run: ${{ env.BINARY_PATH }}/macosx/${{ matrix.file }} version

- name: Output Static
run: otool -L ${{ env.BINARY_PATH }}/macosx/${{ matrix.file }} || true

analyze-linux-aapt:
runs-on: ubuntu-latest
strategy:
matrix:
file: [aapt, aapt_64, aapt2, aapt2_64]

file: [ aapt, aapt_64, aapt2, aapt2_64 ]
steps:
- uses: actions/checkout@v2

- uses: actions/checkout@v3
- name: Verify Executable
run: ${{ env.BINARY_PATH }}/linux/${{ matrix.file }} version

- name: Output Static
run: ldd ${{ env.BINARY_PATH }}/linux/${{ matrix.file }} || true

analyze-windows-aapt:
runs-on: windows-latest
strategy:
matrix:
file: [aapt.exe, aapt_64.exe, aapt2.exe, aapt2_64.exe]

file: [ aapt.exe, aapt_64.exe, aapt2.exe, aapt2_64.exe ]
steps:
- uses: actions/checkout@v2

- uses: actions/checkout@v3
- name: Verify Executable
run: ${{ env.BINARY_PATH }}/windows/${{ matrix.file }} version

- name: Output Static
run: ldd ${{ env.BINARY_PATH }}/windows/${{ matrix.file }} || true

Expand All @@ -69,86 +61,61 @@ jobs:
fail-fast: true
matrix:
os: [ ubuntu-latest, macOS-latest, windows-latest ]
java: [ 8, 9, 10, 11, 12, 13, 14, 15, 16 ]

java: [ 8, 9, 10, 11, 12, 13, 14, 15, 16, 17 ]
Goooler marked this conversation as resolved.
Show resolved Hide resolved
steps:
- uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ matrix.java }}-${{ hashFiles('**/*.gradle*') }}
restore-keys: ${{ runner.os }}-${{ matrix.java }}-gradle-

- uses: actions/checkout@v2

- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v2
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: ${{ matrix.java }}

- name: Build and test
if: startsWith(matrix.os, 'windows') == true
run: ./gradlew.bat build shadowJar proguard

uses: gradle/gradle-build-action@v2
with:
arguments: build shadowJar proguard
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/gradle/gradle-build-action

Ref detekt/detekt#3723, it's really so fast to run jobs, and many other advantages.

- name: Build and test
if: startsWith(matrix.os, 'windows') != true
run: ./gradlew build shadowJar proguard
uses: gradle/gradle-build-action@v2
with:
arguments: build shadowJar proguard

upload-artifact:
runs-on: ubuntu-latest
name: Build apktool.jar
if: github.repository == 'iBotPeaches/Apktool' && github.ref == 'refs/heads/master'
needs:
- build-and-test-with-Java-8-and-later

steps:
- uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ matrix.java }}-${{ hashFiles('**/*.gradle*') }}
restore-keys: ${{ runner.os }}-${{ matrix.java }}-gradle-

- uses: actions/checkout@v2

- name: Set up JDK 10
uses: actions/setup-java@v2
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 10

- name: Build
run: ./gradlew build shadowJar proguard

uses: gradle/gradle-build-action@v2
with:
arguments: build shadowJar proguard
- name: Upload
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: apktool.jar
path: brut.apktool/apktool-cli/build/libs/apktool-*-small.jar

analyze:
name: Analyze
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
language: [ 'java' ]

steps:
- name: Checkout repository
uses: actions/checkout@v2

uses: actions/checkout@v3
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}

- name: Autobuild
uses: github/codeql-action/autobuild@v1

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1