-
Notifications
You must be signed in to change notification settings - Fork 7
wip #229
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
altendky
wants to merge
1
commit into
main
Choose a base branch
from
add_check_architecture
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
wip #229
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,222 @@ | ||
| name: test-cache-pip | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| tags: | ||
| - '**' | ||
| pull_request: | ||
| branches: | ||
| - '**' | ||
|
|
||
| concurrency: | ||
| # SHA is added to the end if on `main` to let all main workflows run | ||
| group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }} | ||
| cancel-in-progress: true | ||
|
|
||
| defaults: | ||
| run: | ||
| shell: bash | ||
|
|
||
| jobs: | ||
| test: | ||
| name: ${{ matrix.os.name }} ${{ matrix.arch.name }} ${{ matrix.python.name }} ${{ matrix.mode.name }} | ||
| runs-on: ${{ matrix.os.runs-on[matrix.arch.matrix] }} | ||
| container: ${{ matrix.os.container[matrix.python.matrix] }} | ||
| timeout-minutes: 5 | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| os: | ||
| - name: macOS | ||
| matrix: macos | ||
| native-python: false | ||
| runs-on: | ||
| arm: [macOS, ARM64] | ||
| intel: [macos-12] | ||
| - name: Ubuntu | ||
| matrix: ubuntu | ||
| native-python: false | ||
| runs-on: | ||
| arm: [Linux, ARM64] | ||
| intel: [ubuntu-latest] | ||
| - name: Docker Debian | ||
| matrix: docker-debian | ||
| native-python: true | ||
| runs-on: | ||
| arm: [Linux, ARM64] | ||
| intel: [ubuntu-latest] | ||
| container: | ||
| 'py3.8': docker://python:3.8-bullseye | ||
| 'py3.9': docker://python:3.9-bullseye | ||
| 'py3.10': docker://python:3.10-bullseye | ||
| 'py3.11': docker://python:3.11-bullseye | ||
| 'py3.12': docker://python:3.12-bullseye | ||
| - name: Windows | ||
| matrix: windows | ||
| native-python: false | ||
| runs-on: | ||
| intel: [windows-latest] | ||
| python: | ||
| - name: '3.8' | ||
| action: '3.8' | ||
| check: '3.8' | ||
| matrix: 'py3.8' | ||
| - name: '3.9' | ||
| action: '3.9' | ||
| check: '3.9' | ||
| matrix: 'py3.9' | ||
| - name: '3.10' | ||
| action: '3.10' | ||
| check: '3.10' | ||
| matrix: 'py3.10' | ||
| - name: '3.11' | ||
| action: '3.11' | ||
| check: '3.11' | ||
| matrix: 'py3.11' | ||
| - name: '3.12' | ||
| action: '3.12' | ||
| check: '3.12' | ||
| matrix: 'py3.12' | ||
| arch: | ||
| - name: ARM | ||
| matrix: arm | ||
| - name: Intel | ||
| matrix: intel | ||
| mode: | ||
| - name: setuptools | ||
| matrix: setuptools | ||
| action: setuptools | ||
| cli: setuptools | ||
| - name: Poetry | ||
| matrix: poetry | ||
| action: poetry | ||
| cli: poetry | ||
| include: | ||
| - os: | ||
| name: Chia Network Ubuntu Intel Builder | ||
| matrix: docker-chia-network-ubuntu-intel-builder | ||
| native-python: true | ||
| runs-on: | ||
| intel: [ubuntu-latest] | ||
| container: | ||
| '3.10': chianetwork/ubuntu-20.04-builder:latest | ||
| python: | ||
| name: '3.10' | ||
| check: '3.10' | ||
| matrix: '3.10' | ||
| arch: | ||
| name: Intel | ||
| matrix: intel | ||
| mode: | ||
| name: Poetry | ||
| matrix: poetry | ||
| action: poetry | ||
| cli: poetry | ||
| - os: | ||
| name: Chia Network Ubuntu ARM Builder | ||
| matrix: docker-chia-network-ubuntu-arm-builder | ||
| native-python: true | ||
| runs-on: | ||
| arm: [Linux, ARM64] | ||
| container: | ||
| '3.10': chianetwork/ubuntu-20.04-builder:latest | ||
| python: | ||
| name: '3.10' | ||
| check: '3.10' | ||
| matrix: '3.10' | ||
| arch: | ||
| name: ARM | ||
| matrix: arm | ||
| mode: | ||
| name: Poetry | ||
| matrix: poetry | ||
| action: poetry | ||
| cli: poetry | ||
| - os: | ||
| name: Chia Network CentOS Intel Builder | ||
| matrix: docker-chia-network-rocky-intel-builder | ||
| native-python: true | ||
| runs-on: | ||
| intel: [ubuntu-latest] | ||
| container: | ||
| '3.10': chianetwork/rocky8-builder:latest | ||
| python: | ||
| name: '3.10' | ||
| check: '3.10' | ||
| matrix: '3.10' | ||
| arch: | ||
| name: Intel | ||
| matrix: intel | ||
| mode: | ||
| name: Poetry | ||
| matrix: poetry | ||
| action: poetry | ||
| cli: poetry | ||
| exclude: | ||
| # Only partial entries are required here by GitHub Actions so generally I | ||
| # only specify the `matrix:` entry. The super linter complains so for now | ||
| # all entries are included to avoid that. Reported at | ||
| # https://github.com/rhysd/actionlint/issues/249 | ||
| - os: | ||
| name: Windows | ||
| matrix: windows | ||
| native-python: false | ||
| runs-on: | ||
| intel: [windows-latest] | ||
| arch: | ||
| name: ARM | ||
| matrix: arm | ||
|
|
||
| env: | ||
| CACHE_DIR_VAR: ${{ (matrix.mode.matrix == 'setuptools' && 'PIP_CACHE_DIR') || (matrix.mode.matrix == 'poetry' && 'POETRY_CACHE_DIR') }} | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| path: repo | ||
|
|
||
| - name: Set up ${{ matrix.python.name }} | ||
| if: ${{ ! matrix.os.native-python }} | ||
| uses: ./repo/setup-python | ||
| with: | ||
| python-version: ${{ matrix.python.action }} | ||
|
|
||
| - name: Run the action (with pre-delete) | ||
| uses: ./repo/cache-pip | ||
| with: | ||
| mode: ${{ matrix.mode.action }} | ||
| pre-delete: "true" | ||
|
|
||
| - name: Check pip cache directory | ||
| run: | | ||
| python repo/cache-pip/test_pip_cache_directory.py "${{ matrix.mode.cli }}" | ||
|
|
||
| - name: Delete the directory | ||
| run: | | ||
| rm -rf "${${{ env.CACHE_DIR_VAR }}}" | ||
|
|
||
| - name: Run the action (no pre-delete) | ||
| uses: ./repo/cache-pip | ||
| with: | ||
| mode: ${{ matrix.mode.action }} | ||
| pre-delete: "false" | ||
|
|
||
| - name: Check pip cache directory | ||
| run: | | ||
| python repo/cache-pip/test_pip_cache_directory.py "${{ matrix.mode.cli }}" | ||
|
|
||
| - name: Touch sentinel file | ||
| run: | | ||
| touch "${${{ env.CACHE_DIR_VAR }}}"/cache_pip_sentinel_file | ||
|
|
||
| - name: Run the action (with pre-delete) | ||
| uses: ./repo/cache-pip | ||
| with: | ||
| mode: ${{ matrix.mode.action }} | ||
| pre-delete: "true" | ||
|
|
||
| - name: Check no sentinel file | ||
| run: | | ||
| [ ! -e "${${{ env.CACHE_DIR_VAR }}}"/cache_pip_sentinel_file ] | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| name: "Check architecture" | ||
| description: "Check that the runner architecture is as expected" | ||
|
|
||
| inputs: | ||
| mode: | ||
| description: "the expected architecture" | ||
| required: true | ||
| type: choice | ||
| options: | ||
| - "intel" | ||
| - "arm" | ||
|
|
||
| runs: | ||
| using: "composite" | ||
| steps: | ||
| - name: Check architecture (Linux/macOS) | ||
| if: runner.os == 'Linux' || runner.os == 'macOS' | ||
| run: | | ||
| CHECK_NAME=$(uname -p) | ||
| echo "CHECK_NAME=${CHECK_NAME}" | ||
| [ "${CHECK_NAME}" = "${{ matrix.os.check-name[matrix.os.matrix] }}" ] | ||
|
|
||
| - name: Check architecture (Windows) | ||
| if: runner.os == 'Windows' | ||
| run: | | ||
| # TODO: actually check | ||
| (Get-CimInstance Win32_operatingsystem).OSArchitecture |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| # Cache pip cache directory to GitHub Actions cache | ||
|
|
||
| Provides caching and pip cache configuration into a runner temporary directory. | ||
|
|
||
| ```yaml | ||
| - uses: Chia-Network/actions/cache-pip@main | ||
| ``` |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium test
Copilot Autofix
AI 5 months ago
To fix the problem, add a
permissionsblock to the workflow file to explicitly set the minimum required permissions for the workflow. The best way to do this is to addpermissions: contents: readat the top level of the workflow file, just after thenameand before theonkey. This will apply the permission restriction to all jobs in the workflow. No changes to the jobs or steps are necessary, and this will not affect existing functionality unless a job or step requires more than read access to repository contents.