Validate #74
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: Validate | |
| # Controls when the action will run. | |
| on: | |
| # Triggers the workflow on push or pull request events but only for the main branch | |
| push: | |
| branches: [ data ] | |
| paths: | |
| - "Samples/**" | |
| pull_request: | |
| branches: [ main , data ] | |
| types: [opened, synchronize, reopened] | |
| paths: | |
| - "Samples/**" | |
| # Allows you to run this workflow manually from the Actions tab | |
| workflow_dispatch: | |
| # A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
| jobs: | |
| Changes: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| press_process: '${{ steps.detect-changes.outputs.press_process }}' | |
| # Steps represent a sequence of tasks that will be executed as part of the job | |
| steps: | |
| - name: Checkout PressMint | |
| uses: actions/checkout@v3 | |
| with: | |
| path: PressMint | |
| fetch-depth: 2 # when called a pull_request - test is run on test merge -> full history is not needed to detect changes | |
| - name: Setup # initialize dependencies cache - used in next steps | |
| uses: ./PressMint/.github/actions/PressMintSetup | |
| - name: PressMint status (Detect changed files and get list of countries that should be processed) | |
| id: detect-changes | |
| uses: ./PressMint/.github/actions/PressMintStatus | |
| - name: Test total TEI file size limit | |
| if: ${{ steps.detect-changes.outputs.max_press_changed_size > 100 && github.event.pull_request.base.ref != 'main' }} | |
| run: | | |
| echo "::error::100MB file limit has been exceed my one country folder" | |
| exit 1 | |
| ValidateCountries: | |
| # The type of runner that the job will run on | |
| runs-on: ubuntu-latest | |
| needs: Changes | |
| strategy: | |
| matrix: | |
| press: ${{ fromJSON(needs.Changes.outputs.press_process) }} | |
| fail-fast: false | |
| steps: | |
| - name: Checkout PressMint | |
| uses: actions/checkout@v3 | |
| with: | |
| path: PressMint | |
| - name: Setup | |
| uses: ./PressMint/.github/actions/PressMintSetup | |
| with: | |
| press: ${{matrix.press}} | |
| - name: Validate PressMint-${{matrix.press}} | |
| uses: ./PressMint/.github/actions/PressMintValidate | |
| with: | |
| press: '${{matrix.press}}' | |
| requireTaxonomiesTranslations: '${{ vars.REQUIRE_TRANSLATIONS }}' | |
| Validate: | |
| runs-on: ubuntu-latest | |
| needs: [ValidateCountries] | |
| steps: | |
| - run: echo Done! | |