fix: 修复主题模式 #487
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Pull Request Check | |
| on: | |
| pull_request: | |
| workflow_dispatch: | |
| jobs: | |
| build_pr: | |
| name: Build PR | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| # Set Current Date As Env Variable | |
| - name: Set current date as env variable | |
| run: echo "date_today=$(date +'%Y-%m-%d')" >> $GITHUB_ENV | |
| # Set Repository Name As Env Variable | |
| - name: Set repository name as env variable | |
| run: echo "repository_name=$(echo '${{ github.repository }}' | awk -F '/' '{print $2}')" >> $GITHUB_ENV | |
| - name: Set Up JDK | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'zulu' # See 'Supported distributions' for available options | |
| java-version: '17' | |
| cache: 'gradle' | |
| - name: Change wrapper permissions | |
| run: chmod +x ./gradlew | |
| - name: Cache Gradle | |
| uses: actions/cache@v3 | |
| with: | |
| path: | | |
| ~/.gradle/caches | |
| ~/.gradle/wrapper | |
| ~/.m2/repository | |
| ./.gradle | |
| ./**/.gradle | |
| ./apk-recompress/target | |
| # dont invalidate cache if only gradle.properties is changed -- they | |
| key: gradle-cache-${{ hashFiles('**/*.gradle.kts', '**/gradle-wrapper.properties') }} | |
| - name: Setup rust | |
| uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| override: true | |
| - name: Install cargo-ndk | |
| run: cargo install cargo-ndk || true | |
| - name: Add Android Rust targets | |
| run: | | |
| rustup target add aarch64-linux-android | |
| rustup target add armv7-linux-androideabi | |
| rustup target add i686-linux-android | |
| rustup target add x86_64-linux-android | |
| - name: Setup Android SDK | |
| uses: android-actions/setup-android@v3 | |
| # Run Tests Build | |
| - name: Run KtLint | |
| run: ./gradlew ktlintCheck | |
| - name: Run gradle tests | |
| run: ./gradlew test | |
| - name: Build App | |
| # Build .apk | |
| run: | | |
| bash ./gradlew assembleFullDebug assembleLiteDebug | |
| env: | |
| CI_BUILD_MINIFY: false | |
| - name: Move files | |
| run: | | |
| mkdir -p app/build/upload | |
| mv app/build/outputs/apk/full/debug/app-full-debug.apk app/build/upload/zhihu++-full-debug.apk | |
| mv app/build/outputs/apk/lite/debug/app-lite-debug.apk app/build/upload/zhihu++-lite-debug.apk | |
| - name: Upload APK | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: PR Debug artifacts | |
| path: app/build/upload/ | |
| - name: Upload test reports | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: PR Test Reports | |
| path: app/build/reports |