Add unit tests for DatabaseDownloader #45
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: Release – SQLite DBs (Policies & Store) | |
| on: | |
| pull_request: | |
| types: [closed] | |
| branches: | |
| - master | |
| permissions: | |
| contents: write | |
| jobs: | |
| build-and-release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 0 | |
| - name: Define release name (once for all steps) | |
| run: echo "RELEASE_NAME=$(date +'%Y%m%d%H%M')" >> $GITHUB_ENV | |
| - name: Set up Java 17 | |
| uses: actions/setup-java@v3 | |
| with: | |
| distribution: temurin | |
| java-version: '17' | |
| - name: Cache Gradle dependencies | |
| uses: actions/cache@v3 | |
| with: | |
| path: | | |
| ~/.gradle/caches | |
| ~/.gradle/wrapper | |
| key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*','**/gradle-wrapper.properties') }} | |
| - name: Build project and export SQLite DBs | |
| run: | | |
| # Build and run both generators using the new task | |
| ./gradlew runGenerators --quiet | |
| # Verify the generated database files | |
| ls -l generators/policies/build/policies-database.db | |
| ls -l generators/store/build/store-database-en.db | |
| ls -l generators/store/build/store-database-fr.db | |
| ls -l generators/store/build/store-database-he.db | |
| - name: Create and push tag | |
| run: | | |
| git config --global user.name "github-actions" | |
| git config --global user.email "github-actions@users.noreply.github.com" | |
| git fetch --prune | |
| git tag "${{ env.RELEASE_NAME }}" "${{ github.sha }}" | |
| git push origin "${{ env.RELEASE_NAME }}" | |
| - name: Create GitHub release and upload artifacts | |
| uses: softprops/action-gh-release@v2.1.0 | |
| with: | |
| tag_name: ${{ env.RELEASE_NAME }} | |
| name: ${{ env.RELEASE_NAME }} | |
| files: | | |
| generators/policies/build/policies-database.db | |
| generators/store/build/store-database-en.db | |
| generators/store/build/store-database-fr.db | |
| generators/store/build/store-database-he.db |