| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,76 @@ | |||
| 1 | + name: test-alpine | ||
| 2 | + | ||
| 3 | + on: [push, pull_request, workflow_dispatch] | ||
| 4 | + | ||
| 5 | + permissions: | ||
| 6 | + contents: read | ||
| 7 | + | ||
| 8 | + jobs: | ||
| 9 | + test: | ||
| 10 | + runs-on: ubuntu-latest | ||
| 11 | + | ||
| 12 | + container: | ||
| 13 | + image: alpine:latest | ||
| 14 | + | ||
| 15 | + defaults: | ||
| 16 | + run: | ||
| 17 | + shell: sudo -u runner sh -exo pipefail {0} | ||
| 18 | + | ||
| 19 | + steps: | ||
| 20 | + - name: Prepare Alpine Linux | ||
| 21 | + run: | | ||
| 22 | + apk add sudo git git-daemon python3 py3-pip py3-virtualenv | ||
| 23 | + echo 'Defaults env_keep += "CI GITHUB_* RUNNER_*"' >/etc/sudoers.d/ci_env | ||
| 24 | + addgroup -g 127 docker | ||
| 25 | + adduser -D -u 1001 runner # TODO: Check if this still works on GHA as intended. | ||
| 26 | + adduser runner docker | ||
| 27 | + shell: sh -exo pipefail {0} # Run this as root, not the "runner" user. | ||
| 28 | + | ||
| 29 | + - uses: actions/checkout@v6 | ||
| 30 | + with: | ||
| 31 | + fetch-depth: 0 | ||
| 32 | + | ||
| 33 | + - name: Set workspace ownership | ||
| 34 | + run: | | ||
| 35 | + chown -R runner:docker -- "$GITHUB_WORKSPACE" | ||
| 36 | + shell: sh -exo pipefail {0} # Run this as root, not the "runner" user. | ||
| 37 | + | ||
| 38 | + - name: Prepare this repo for tests | ||
| 39 | + run: | | ||
| 40 | + ./init-tests-after-clone.sh | ||
| 41 | + | ||
| 42 | + - name: Set git user identity and command aliases for the tests | ||
| 43 | + run: | | ||
| 44 | + git config --global user.email "travis@ci.com" | ||
| 45 | + git config --global user.name "Travis Runner" | ||
| 46 | + # If we rewrite the user's config by accident, we will mess it up | ||
| 47 | + # and cause subsequent tests to fail | ||
| 48 | + cat test/fixtures/.gitconfig >> ~/.gitconfig | ||
| 49 | + | ||
| 50 | + - name: Set up virtual environment | ||
| 51 | + run: | | ||
| 52 | + python -m venv .venv | ||
| 53 | + | ||
| 54 | + - name: Update PyPA packages | ||
| 55 | + run: | | ||
| 56 | + . .venv/bin/activate | ||
| 57 | + python -m pip install -U pip 'setuptools; python_version<"3.12"' wheel | ||
| 58 | + | ||
| 59 | + - name: Install project and test dependencies | ||
| 60 | + run: | | ||
| 61 | + . .venv/bin/activate | ||
| 62 | + pip install '.[test]' | ||
| 63 | + | ||
| 64 | + - name: Show version and platform information | ||
| 65 | + run: | | ||
| 66 | + . .venv/bin/activate | ||
| 67 | + uname -a | ||
| 68 | + command -v git python | ||
| 69 | + git version | ||
| 70 | + python --version | ||
| 71 | + python -c 'import os, sys; print(f"sys.platform={sys.platform!r}, os.name={os.name!r}")' | ||
| 72 | + | ||
| 73 | + - name: Test with pytest | ||
| 74 | + run: | | ||
| 75 | + . .venv/bin/activate | ||
| 76 | + pytest --color=yes -p no:sugar --instafail -vv | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -19,62 +19,72 @@ on: | |||
| 19 | 19 | ||
| 20 | 20 | jobs: | |
| 21 | 21 | analyze: | |
| 22 | - name: Analyze | ||
| 22 | + name: Analyze (${{ matrix.language }}) | ||
| 23 | 23 | # Runner size impacts CodeQL analysis time. To learn more, please see: | |
| 24 | 24 | # - https://gh.io/recommended-hardware-resources-for-running-codeql | |
| 25 | 25 | # - https://gh.io/supported-runners-and-hardware-resources | |
| 26 | - # - https://gh.io/using-larger-runners | ||
| 27 | - # Consider using larger runners for possible analysis time improvements. | ||
| 26 | + # - https://gh.io/using-larger-runners (GitHub.com only) | ||
| 27 | + # Consider using larger runners or machines with greater resources for possible analysis time improvements. | ||
| 28 | 28 | runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }} | |
| 29 | - timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }} | ||
| 30 | 29 | permissions: | |
| 31 | - actions: read | ||
| 32 | - contents: read | ||
| 33 | 30 | security-events: write | |
| 34 | 31 | ||
| 35 | 32 | strategy: | |
| 36 | 33 | fail-fast: false | |
| 37 | 34 | matrix: | |
| 38 | - language: [ 'python' ] | ||
| 39 | - # CodeQL supports [ 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift' ] | ||
| 40 | - # Use only 'java-kotlin' to analyze code written in Java, Kotlin or both | ||
| 41 | - # Use only 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both | ||
| 42 | - # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support | ||
| 43 | - | ||
| 35 | + include: | ||
| 36 | + - language: actions | ||
| 37 | + build-mode: none | ||
| 38 | + - language: python | ||
| 39 | + build-mode: none | ||
| 40 | + # CodeQL supports the following values keywords for 'language': 'actions', 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift' | ||
| 41 | + # Use `c-cpp` to analyze code written in C, C++ or both | ||
| 42 | + # Use 'java-kotlin' to analyze code written in Java, Kotlin or both | ||
| 43 | + # Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both | ||
| 44 | + # To learn more about changing the languages that are analyzed or customizing the build mode for your analysis, | ||
| 45 | + # see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning. | ||
| 46 | + # If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how | ||
| 47 | + # your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages | ||
| 44 | 48 | steps: | |
| 45 | 49 | - name: Checkout repository | |
| 46 | - uses: actions/checkout@v4 | ||
| 50 | + uses: actions/checkout@v6 | ||
| 51 | + | ||
| 52 | + # Add any setup steps before running the `github/codeql-action/init` action. | ||
| 53 | + # This includes steps like installing compilers or runtimes (`actions/setup-node` | ||
| 54 | + # or others). This is typically only required for manual builds. | ||
| 55 | + # - name: Setup runtime (example) | ||
| 56 | + # uses: actions/setup-example@v1 | ||
| 47 | 57 | ||
| 48 | 58 | # Initializes the CodeQL tools for scanning. | |
| 49 | 59 | - name: Initialize CodeQL | |
| 50 | - uses: github/codeql-action/init@v2 | ||
| 60 | + uses: github/codeql-action/init@v4 | ||
| 51 | 61 | with: | |
| 52 | 62 | languages: ${{ matrix.language }} | |
| 53 | - setup-python-dependencies: false | ||
| 63 | + build-mode: ${{ matrix.build-mode }} | ||
| 54 | 64 | # If you wish to specify custom queries, you can do so here or in a config file. | |
| 55 | 65 | # By default, queries listed here will override any specified in a config file. | |
| 56 | 66 | # Prefix the list here with "+" to use these queries and those in the config file. | |
| 57 | 67 | ||
| 58 | 68 | # For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs | |
| 59 | 69 | # queries: security-extended,security-and-quality | |
| 60 | 70 | ||
| 61 | - | ||
| 62 | - # Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift). | ||
| 63 | - # If this step fails, then you should remove it and run the build manually (see below) | ||
| 64 | - - name: Autobuild | ||
| 65 | - uses: github/codeql-action/autobuild@v2 | ||
| 66 | - | ||
| 71 | + # If the analyze step fails for one of the languages you are analyzing with | ||
| 72 | + # "We were unable to automatically build your code", modify the matrix above | ||
| 73 | + # to set the build mode to "manual" for that language. Then modify this step | ||
| 74 | + # to build your code. | ||
| 67 | 75 | # ℹ️ Command-line programs to run using the OS shell. | |
| 68 | 76 | # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun | |
| 69 | - | ||
| 70 | - # If the Autobuild fails above, remove it and uncomment the following three lines. | ||
| 71 | - # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. | ||
| 72 | - | ||
| 73 | - # - run: | | ||
| 74 | - # echo "Run, Build Application using script" | ||
| 75 | - # ./location_of_script_within_repo/buildscript.sh | ||
| 77 | + - if: matrix.build-mode == 'manual' | ||
| 78 | + shell: bash | ||
| 79 | + run: | | ||
| 80 | + echo 'If you are using a "manual" build mode for one or more of the' \ | ||
| 81 | + 'languages you are analyzing, replace this with the commands to build' \ | ||
| 82 | + 'your code, for example:' | ||
| 83 | + echo ' make bootstrap' | ||
| 84 | + echo ' make release' | ||
| 85 | + exit 1 | ||
| 76 | 86 | ||
| 77 | 87 | - name: Perform CodeQL Analysis | |
| 78 | - uses: github/codeql-action/analyze@v2 | ||
| 88 | + uses: github/codeql-action/analyze@v4 | ||
| 79 | 89 | with: | |
| 80 | 90 | category: "/language:${{matrix.language}}" | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2,13 +2,24 @@ name: test-cygwin | |||
| 2 | 2 | ||
| 3 | 3 | on: [push, pull_request, workflow_dispatch] | |
| 4 | 4 | ||
| 5 | - jobs: | ||
| 6 | - build: | ||
| 7 | - runs-on: windows-latest | ||
| 5 | + permissions: | ||
| 6 | + contents: read | ||
| 8 | 7 | ||
| 8 | + jobs: | ||
| 9 | + test: | ||
| 9 | 10 | strategy: | |
| 11 | + matrix: | ||
| 12 | + selection: [fast, perf] | ||
| 13 | + include: | ||
| 14 | + - selection: fast | ||
| 15 | + additional-pytest-args: --ignore=test/performance | ||
| 16 | + - selection: perf | ||
| 17 | + additional-pytest-args: test/performance | ||
| 18 | + | ||
| 10 | 19 | fail-fast: false | |
| 11 | 20 | ||
| 21 | + runs-on: windows-latest | ||
| 22 | + | ||
| 12 | 23 | env: | |
| 13 | 24 | CHERE_INVOKING: "1" | |
| 14 | 25 | CYGWIN_NOWINPATH: "1" | |
@@ -21,16 +32,16 @@ jobs: | |||
| 21 | 32 | - name: Force LF line endings | |
| 22 | 33 | run: | | |
| 23 | 34 | git config --global core.autocrlf false # Affects the non-Cygwin git. | |
| 24 | - shell: bash # Use Git Bash instead of Cygwin Bash for this step. | ||
| 35 | + shell: pwsh # Do this outside Cygwin, to affect actions/checkout. | ||
| 25 | 36 | ||
| 26 | - - uses: actions/checkout@v4 | ||
| 37 | + - uses: actions/checkout@v6 | ||
| 27 | 38 | with: | |
| 28 | 39 | fetch-depth: 0 | |
| 29 | 40 | ||
| 30 | 41 | - name: Install Cygwin | |
| 31 | - uses: cygwin/cygwin-install-action@v4 | ||
| 42 | + uses: cygwin/cygwin-install-action@v6 | ||
| 32 | 43 | with: | |
| 33 | - packages: python39 python39-pip python39-virtualenv git | ||
| 44 | + packages: git python39 python-pip-wheel python-setuptools-wheel python-wheel-wheel | ||
| 34 | 45 | add-to-path: false # No need to change $PATH outside the Cygwin environment. | |
| 35 | 46 | ||
| 36 | 47 | - name: Arrange for verbose output | |
@@ -41,6 +52,7 @@ jobs: | |||
| 41 | 52 | - name: Special configuration for Cygwin git | |
| 42 | 53 | run: | | |
| 43 | 54 | git config --global --add safe.directory "$(pwd)" | |
| 55 | + git config --global --add safe.directory "$(pwd)/.git" | ||
| 44 | 56 | git config --global core.autocrlf false | |
| 45 | 57 | ||
| 46 | 58 | - name: Prepare this repo for tests | |
@@ -55,14 +67,18 @@ jobs: | |||
| 55 | 67 | # and cause subsequent tests to fail | |
| 56 | 68 | cat test/fixtures/.gitconfig >> ~/.gitconfig | |
| 57 | 69 | ||
| 70 | + - name: Set up virtual environment | ||
| 71 | + run: | | ||
| 72 | + python3.9 -m venv .venv | ||
| 73 | + echo 'BASH_ENV=.venv/bin/activate' >>"$GITHUB_ENV" | ||
| 74 | + | ||
| 58 | 75 | - name: Update PyPA packages | |
| 59 | 76 | run: | | |
| 60 | - # Get the latest pip, wheel, and prior to Python 3.12, setuptools. | ||
| 61 | - python -m pip install -U pip $(pip freeze --all | grep -oF setuptools) wheel | ||
| 77 | + python -m pip install -U pip 'setuptools; python_version<"3.12"' wheel | ||
| 62 | 78 | ||
| 63 | 79 | - name: Install project and test dependencies | |
| 64 | 80 | run: | | |
| 65 | - pip install ".[test]" | ||
| 81 | + pip install '.[test]' | ||
| 66 | 82 | ||
| 67 | 83 | - name: Show version and platform information | |
| 68 | 84 | run: | | |
@@ -72,6 +88,6 @@ jobs: | |||
| 72 | 88 | python --version | |
| 73 | 89 | python -c 'import os, sys; print(f"sys.platform={sys.platform!r}, os.name={os.name!r}")' | |
| 74 | 90 | ||
| 75 | - - name: Test with pytest | ||
| 91 | + - name: Test with pytest (${{ matrix.additional-pytest-args }}) | ||
| 76 | 92 | run: | | |
| 77 | - pytest --color=yes -p no:sugar --instafail -vv | ||
| 93 | + pytest --color=yes -p no:sugar --instafail -vv ${{ matrix.additional-pytest-args }} | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2,19 +2,18 @@ name: Lint | |||
| 2 | 2 | ||
| 3 | 3 | on: [push, pull_request, workflow_dispatch] | |
| 4 | 4 | ||
| 5 | + permissions: | ||
| 6 | + contents: read | ||
| 7 | + | ||
| 5 | 8 | jobs: | |
| 6 | 9 | lint: | |
| 7 | 10 | runs-on: ubuntu-latest | |
| 8 | 11 | ||
| 9 | 12 | steps: | |
| 10 | - - uses: actions/checkout@v4 | ||
| 13 | + - uses: actions/checkout@v6 | ||
| 11 | 14 | ||
| 12 | - - uses: actions/setup-python@v5 | ||
| 15 | + - uses: actions/setup-python@v6 | ||
| 13 | 16 | with: | |
| 14 | 17 | python-version: "3.x" | |
| 15 | 18 | ||
| 16 | - - uses: pre-commit/action@v3.0.0 | ||
| 17 | - with: | ||
| 18 | - extra_args: --all-files --hook-stage manual | ||
| 19 | - env: | ||
| 20 | - SKIP: black-format | ||
| 19 | + - uses: pre-commit/action@v3.0.1 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments