fix: minor cleanups and CI/CD changes #26
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
| # .github/workflows/test-validity-of-clafer-files.yml | |
| # Author: Luke Myers, Daniel M. Zimmerman | |
| # Created: 2024-09-25 | |
| # Modified: 2024-09-28 | |
| name: Test Validity of Clafer Files | |
| on: | |
| push: | |
| branches: | |
| - 'main' | |
| workflow_dispatch: | |
| jobs: | |
| build-matrix: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| clafer-files: ${{ steps.generate-matrix.outputs.clafer-files }} | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 | |
| - name: Generate Matrix | |
| id: generate-matrix | |
| shell: bash | |
| run: | | |
| # Find all .cfr files and convert to JSON array | |
| files=$(find . -type f -name '*.cfr' -print0 | xargs -0 -n1 printf "%s\n" | jq -R . | jq -s .) | |
| # Set the output using multiline syntax | |
| echo "clafer-files<<EOF" >> $GITHUB_OUTPUT | |
| echo "$files" >> $GITHUB_OUTPUT | |
| echo "EOF" >> $GITHUB_OUTPUT | |
| test: | |
| name: Check Clafer Syntax | |
| needs: build-matrix | |
| runs-on: ubuntu-latest | |
| if: fromJson(needs.build-matrix.outputs.clafer-files)[0] != null | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| clafer-file: ${{ fromJson(needs.build-matrix.outputs.clafer-files) }} | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 | |
| - name: Log in to Docker Hub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKER_READ_ONLY_TOKEN_USERNAME }} | |
| password: ${{ secrets.DOCKER_READ_ONLY_TOKEN }} | |
| - name: Pull Docker Image | |
| run: docker pull freeandfair/de-ple-e2eviv:latest | |
| - name: Run `clafer` on ${{ matrix.clafer-file }} | |
| run: | | |
| echo "Processing ${{ matrix.clafer-file }}" | |
| docker run --rm \ | |
| -v "${{ github.workspace }}":/workspace \ | |
| -w /workspace \ | |
| freeandfair/de-ple-e2eviv:latest \ | |
| clafer -v "/workspace/${{ matrix.clafer-file }}" |