Integration Tests #184
This file contains 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: Integration Tests | |
on: | |
schedule: | |
- cron: "0 11 * * 0" # 11:00 UTC (=4am PST) every Sunday | |
workflow_dispatch: # allow manual trigger | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-java@v4 | |
with: | |
distribution: 'adopt' | |
java-version: '21' | |
- name: Download B2 binary | |
run: curl https://github.com/Backblaze/B2_Command_Line_Tool/releases/download/v2.1.0/b2-linux -L -o b2 | |
- run: chmod +x b2 | |
- name: Authorize B2 account | |
run: ./b2 authorize-account $B2_APPKEY_ID $B2_APPKEY | |
env: | |
B2_APPKEY_ID: ${{ secrets.B2_APPKEY_ID }} | |
B2_APPKEY: ${{ secrets.B2_APPKEY }} | |
- run: mkdir -p .kotify/test-cache | |
- name: Download access_token.json from B2 | |
run: ./b2 download-file-by-name $B2_BUCKET_NAME access_token.json .kotify/test-cache/access_token.json | |
env: | |
B2_BUCKET_NAME: ${{ secrets.B2_BUCKET_NAME }} | |
- name: Run tests | |
run: ./gradlew --stacktrace --continue integrationTest | |
- name: Upload test results to codecov | |
uses: codecov/codecov-action@v4 | |
if: always() # upload even if the build failed, in case it was just test failures | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
fail_ci_if_error: true | |
verbose: true | |
flags: integration | |
- name: Upload access_token.json to B2 (in case it was refreshed) | |
run: ./b2 upload-file ${B2_BUCKET_NAME} .kotify/test-cache/access_token.json access_token.json | |
if: always() # upload even if the build failed | |
env: | |
B2_BUCKET_NAME: ${{ secrets.B2_BUCKET_NAME }} |