|
| 1 | +name: readme_snippets |
| 2 | + |
| 3 | +defaults: |
| 4 | + run: |
| 5 | + shell: bash |
| 6 | + |
| 7 | +on: |
| 8 | + push: |
| 9 | + branches: [ main ] |
| 10 | + pull_request: |
| 11 | + branches: [ main ] |
| 12 | + schedule: |
| 13 | + - cron: '0 13 * * 4' |
| 14 | + |
| 15 | +jobs: |
| 16 | + python: |
| 17 | + runs-on: ubuntu-latest |
| 18 | + steps: |
| 19 | + - uses: actions/checkout@v2 |
| 20 | + - uses: actions/setup-python@v1 |
| 21 | + with: |
| 22 | + python-version: 3.9 |
| 23 | + - run: pip install -e . |
| 24 | + - run: pip install -r test-time-requirements.txt |
| 25 | + - run: pip install pytest-codeblocks pytest |
| 26 | + - run: python -c "import pytest_codeblocks; code=pytest_codeblocks.extract_from_file('README.md'); f=open('readme.py', 'w'); f.writelines(block.code for block in code if block.syntax=='Python'); f.close()" |
| 27 | + - run: python -We readme.py |
| 28 | + - run: sed -i 's/CPU/GPU/g' readme.py |
| 29 | + - run: python -We readme.py |
| 30 | + |
| 31 | + - name: artefacts |
| 32 | + if: github.ref == 'refs/heads/main' |
| 33 | + uses: eine/tip@master |
| 34 | + with: |
| 35 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 36 | + files: | |
| 37 | + readme.png |
| 38 | +
|
| 39 | + julia: |
| 40 | + runs-on: ubuntu-latest |
| 41 | + steps: |
| 42 | + - uses: actions/checkout@v2 |
| 43 | + - uses: actions/setup-python@v1 |
| 44 | + with: |
| 45 | + python-version: 3.9 |
| 46 | + - run: pip install -e . |
| 47 | + - run: pip install pytest-codeblocks pytest |
| 48 | + - run: python -c "import pytest_codeblocks; code=pytest_codeblocks.extract_from_file('README.md'); f=open('readme.jl', 'w'); f.writelines(block.code for block in code if block.syntax=='Julia'); f.close()" |
| 49 | + - uses: julia-actions/setup-julia@v1 |
| 50 | + - run: cat -n readme.jl |
| 51 | + - run: julia readme.jl |
| 52 | + - run: sed -i 's/CPU/GPU/g' readme.jl |
| 53 | + - run: julia readme.jl |
| 54 | + |
| 55 | + matlab: |
| 56 | + runs-on: ubuntu-latest |
| 57 | + steps: |
| 58 | + - uses: actions/checkout@v2 |
| 59 | + - uses: actions/setup-python@v1 |
| 60 | + with: |
| 61 | + python-version: 3.8 |
| 62 | + - run: pip install -e . |
| 63 | + - run: pip install pytest-codeblocks pytest |
| 64 | + - run: python -c "import pytest_codeblocks; code=pytest_codeblocks.extract_from_file('README.md'); f=open('readme.m', 'w'); f.writelines(block.code for block in code if block.syntax=='Matlab'); f.close()" |
| 65 | + - run: cat -n readme.m |
| 66 | + - uses: matlab-actions/setup-matlab@v0 |
| 67 | + with: |
| 68 | + release: R2021a |
| 69 | + - uses: matlab-actions/run-command@v0 |
| 70 | + with: |
| 71 | + command: readme |
| 72 | + - run: sed -i 's/CPU/GPU/g' readme.m |
| 73 | + - uses: matlab-actions/run-command@v0 |
| 74 | + with: |
| 75 | + command: readme |
| 76 | + |
| 77 | + - name: artefacts |
| 78 | + if: github.ref == 'refs/heads/main' |
| 79 | + uses: eine/tip@master |
| 80 | + with: |
| 81 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 82 | + files: | |
| 83 | + parcel.png |
| 84 | +
|
0 commit comments