CI/CD Process #291
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: CI/CD Process | |
on: | |
pull_request: | |
workflow_dispatch: | |
# Schedule the workflow to run every 6 hours | |
schedule: | |
- cron: "0 */6 * * *" | |
jobs: | |
basic-checks: | |
name: Basic checks | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
# Build Gradle which perform project building | |
- name: Build | |
run: ./gradlew assemble | |
# Checking the linting | |
- name: Lint | |
run: ./gradlew ktlintCheck | |
# Checking the unit tests | |
- name: Test | |
run: ./gradlew test | |
env: | |
RIOT_API_KEY: ${{ secrets.TEST_RIOT_API_KEY }} | |
# Hide the API key from the artifacts | |
- name: Hide API key | |
run: ./.github/util/hide_api_key.sh $RIOT_API_KEY riot-api/build/reports/tests | |
if: failure() | |
env: | |
RIOT_API_KEY: ${{ secrets.TEST_RIOT_API_KEY }} | |
# Upload the test results if the tests fail | |
- name: Upload failed tests | |
uses: actions/upload-artifact@v4 | |
if: failure() | |
with: | |
name: test-results | |
path: riot-api/build/reports/tests/test |