test #478
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: test | |
| on: | |
| # Run on each commit to this repo. | |
| push: | |
| # Run on pull requests. | |
| pull_request: | |
| branches: | |
| - main | |
| # Daily at 10AM UTC | |
| schedule: | |
| - cron: "0 10 * * *" | |
| # Allow manual activations. | |
| workflow_dispatch: | |
| inputs: | |
| commit_sha: | |
| description: "[Optional] examples commit SHA to test" | |
| required: false | |
| default: "" | |
| permissions: | |
| # Allow release creation | |
| contents: write | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Determine commit to use | |
| run: | | |
| # Strip leading and trailing spaces | |
| sha="$(echo "${{ github.event.inputs.commit_sha }}" | xargs)" | |
| # User specified commit SHA. | |
| if [ -n "$sha" ]; then | |
| echo "COMMIT_SHA=$sha" >> $GITHUB_ENV | |
| echo "COMMIT_NOTE=Using manual commit" >> $GITHUB_ENV | |
| # Default behavior, use latest commit. | |
| else | |
| echo "COMMIT_SHA=${{ github.sha }}" >> $GITHUB_ENV | |
| echo "COMMIT_NOTE=Using latest commit" >> $GITHUB_ENV | |
| fi | |
| - name: Show selected commit | |
| run: | | |
| echo "$COMMIT_NOTE" | |
| echo "Selected: $COMMIT_SHA" | |
| echo "Latest: ${{github.sha}}" | |
| - name: Checkout this repo | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: ${{env.COMMIT_SHA}} | |
| - name: Install the latest python | |
| uses: actions/setup-python@v5 | |
| # with: | |
| # python-version: "3.14" | |
| - name: Show python version | |
| run: | | |
| python --version | |
| - name: Install latest apio dev | |
| run: | | |
| pip install --force-reinstall -U \ git+https://github.com/fpgawars/apio.git | |
| - name: Copy common files to each example | |
| run: | | |
| ls -al . | |
| ls -al ./scripts | |
| python ./scripts/copy-common-files.py | |
| - name: Run the python test script | |
| run: | | |
| python ./test.py |