diff options
Diffstat (limited to '.github')
-rw-r--r-- | .github/FUNDING.yml | 12 | ||||
-rw-r--r-- | .github/ISSUE_TEMPLATE/bug_report.yml | 73 | ||||
-rw-r--r-- | .github/ISSUE_TEMPLATE/config.yml | 10 | ||||
-rw-r--r-- | .github/ISSUE_TEMPLATE/feature_request.yml | 72 | ||||
-rw-r--r-- | .github/workflows/bisects.yml | 31 | ||||
-rw-r--r-- | .github/workflows/ci_docs.yml | 116 | ||||
-rw-r--r-- | .github/workflows/ci_gcc14.yml | 76 | ||||
-rw-r--r-- | .github/workflows/ci_packages.yml | 74 | ||||
-rw-r--r-- | .github/workflows/ci_publish.yml | 90 | ||||
-rw-r--r-- | .github/workflows/stale.yml | 25 |
10 files changed, 579 insertions, 0 deletions
diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 000000000..dc771dd31 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] +patreon: 'araq' # Replace with a single Patreon username +open_collective: 'nim' # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: 'https://nim-lang.org/donate.html' # Replace with a single custom sponsorship URL diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 000000000..1e46e0544 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,73 @@ +name: "Bug Report" +description: "Create a new bug report. Have you found an unexpected behavior? Use this form." +title: "Think about the title, twice." +labels: ["unconfirmed"] +body: + +- type: markdown + attributes: + value: | + Please provide a minimal code example that reproduces the bug if possible. + Reports with a reproducible example or detailed information will likely receive fixes faster. + +- type: textarea + id: description + attributes: + label: Description + description: | + Describe the problem. Code example can be given here. + placeholder: Bug reports with reproducible code or detailed information will be fixed faster. + validations: + required: true + +- type: textarea + id: nim-version + attributes: + label: Nim Version + description: | + Can be obtained from `nim -v` on the command line along with the OS/architecture. + For development versions, make sure to include the commit hash. + validations: + required: true + +- type: textarea + id: current-logs + attributes: + label: Current Output + description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks. + placeholder: Bug reports with reproducible code or detailed information will be fixed faster. + render: text + +- type: textarea + id: expected-logs + attributes: + label: Expected Output + description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks. + placeholder: Bug reports with reproducible code or detailed information will be fixed faster. + render: text + +- type: textarea + id: known-workarounds + attributes: + label: Known Workarounds + description: Provide any known workarounds. + validations: + required: false + +- type: textarea + id: extra-info + attributes: + label: Additional Information + description: Any additional relevant information. + validations: + required: false + +- type: markdown + attributes: + value: | + - Please check whether the problem still exists in the devel branch, which can be installed via [choosenim](https://github.com/nim-lang/choosenim/), [nightlies](https://github.com/nim-lang/nightlies/), or by [creating a temporary build of the compiler](https://nim-lang.github.io/Nim/intern.html#debugging-the-compiler-building-an-instrumented-compiler). + - Consider writing a PR targetting devel branch after filing this, see [contributing](https://nim-lang.github.io/Nim/contributing.html). + - If it's a pre-existing compiler bug, see [debugging the compiler](https://nim-lang.github.io/Nim/intern.html#debugging-the-compiler) which should give more context on a compiler crash. + - If it's a regression, you can help us by identifying which version introduced the bug by [bisecting](https://nim-lang.github.io/Nim/intern.html#bisecting-for-regressions) or at least trying known past releases (e.g. `choosenim 2.0.0`). + The Nim repo also supports bisecting in issue comments by adding `!nim c`, `!nim js` etc. before a code block, see [nimrun-action](https://github.com/juancarlospaco/nimrun-action). + - [Please, consider a Donation for the Nim project.](https://nim-lang.org/donate.html) diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 000000000..0187064b5 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,10 @@ +contact_links: + - name: Forum + url: https://forum.nim-lang.org + about: Please ask and answer questions here. + - name: Discord + url: https://discord.gg/nim + about: Please ask and answer questions here. + - name: Stack Overflow + url: https://stackoverflow.com/questions/tagged/nim-lang + about: Please ask and answer questions here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml new file mode 100644 index 000000000..5cb458626 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -0,0 +1,72 @@ +name: "Feature request" +description: "Create a new Feature Request. Do you want to suggest a new feature? Use this form." +title: "Think about the title, twice." +labels: ["unconfirmed"] +body: + +- type: markdown + attributes: + value: | + - Please provide a minimal code example that illustrates the basic idea behind your feature request. + Reports with full repro code and descriptive detailed information will likely receive feedback faster. + - There is a separate repository for the detailed RFCs and proposals: https://github.com/nim-lang/RFCs. + If you have a simple feature request, you can post it here using this form, + but bear in mind that adding new features to the language is currently a low priority. + +- type: textarea + id: summary + attributes: + label: Summary + description: | + Use DETAILED DESCRIPTIVE information about the feature request. + Here, you go into more details about your ideas. This section can be a few paragraphs long. + placeholder: Short summary of your proposed feature. + validations: + required: true + +- type: textarea + id: description + attributes: + label: Description + description: Describe your solution, what problem does it fix? + validations: + required: true + +- type: textarea + id: alternatives + attributes: + label: Alternatives + description: Are there any alternatives you've considered? + validations: + required: false + +- type: textarea + id: Examples + attributes: + label: Examples + description: Provide examples for your feature request here. + placeholder: Example code here. + +- type: textarea + id: incompatibility + attributes: + label: Backwards Compatibility + description: If your Feature Request introduces backward-incompatible changes, describe them and propose how to deal with them. + validations: + required: false + +- type: textarea + id: links + attributes: + label: Links + description: Please copy and paste any relevant links to projects, issues, discussions, technical documentations, code samples, etc. + validations: + required: false + +- type: markdown + attributes: + value: | + - Thanks for your contributions!, your ideas will receive feedback from the community soon... + - **Remember to :star: Star the Nim project on GitHub!.** + - Consider writing a PR targetting devel branch after filing this, see [contributing](https://nim-lang.github.io/Nim/contributing.html). + - [Please, consider a Donation for the Nim project.](https://nim-lang.org/donate.html) diff --git a/.github/workflows/bisects.yml b/.github/workflows/bisects.yml new file mode 100644 index 000000000..4a6a92f01 --- /dev/null +++ b/.github/workflows/bisects.yml @@ -0,0 +1,31 @@ +# See https://github.com/juancarlospaco/nimrun-action/issues/3#issuecomment-1607344901 +name: issue comments bisects +on: + issue_comment: + types: created + +jobs: + bisects: + if: | + github.event_name == 'issue_comment' && startsWith(github.event.comment.body, '!nim ') && github.event.issue.pull_request == null && github.event.comment.author_association != 'NONE' + strategy: + fail-fast: false + matrix: + platform: [ubuntu-latest, windows-latest, macos-latest] + name: ${{ matrix.platform }}-bisects + runs-on: ${{ matrix.platform }} + steps: + - uses: actions/checkout@v4 + + - uses: jiro4989/setup-nim-action@v1 + with: + nim-version: 'devel' + + - uses: juancarlospaco/nimrun-action@nim + if: | + runner.os == 'Linux' && contains(github.event.comment.body, '-d:linux' ) || + runner.os == 'Windows' && contains(github.event.comment.body, '-d:windows') || + runner.os == 'macOS' && contains(github.event.comment.body, '-d:osx' ) || + runner.os == 'Linux' && !contains(github.event.comment.body, '-d:linux') && !contains(github.event.comment.body, '-d:windows') && !contains(github.event.comment.body, '-d:osx') + with: + github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/ci_docs.yml b/.github/workflows/ci_docs.yml new file mode 100644 index 000000000..2faa37ce0 --- /dev/null +++ b/.github/workflows/ci_docs.yml @@ -0,0 +1,116 @@ +name: Nim Docs CI +on: + push: + paths: + - 'compiler/**.nim' + - 'config/nimdoc.cfg' + - 'doc/**.rst' + - 'doc/**.md' + - 'doc/nimdoc.css' + - 'lib/**.nim' + - 'nimdoc/testproject/expected/testproject.html' + - 'tools/dochack/dochack.nim' + - 'tools/kochdocs.nim' + - '.github/workflows/ci_docs.yml' + - 'koch.nim' + + pull_request: + # Run only on changes on these files. + paths: + - 'compiler/**.nim' + - 'config/nimdoc.cfg' + - 'doc/**.rst' + - 'doc/**.md' + - 'doc/nimdoc.css' + - 'lib/**.nim' + - 'nimdoc/testproject/expected/testproject.html' + - 'tools/dochack/dochack.nim' + - 'tools/kochdocs.nim' + - '.github/workflows/ci_docs.yml' + - 'koch.nim' + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + build: + strategy: + fail-fast: false + matrix: + target: [linux, windows, osx] + include: + - target: linux + os: ubuntu-20.04 + - target: windows + os: windows-2019 + - target: osx + os: macos-12 + + name: ${{ matrix.target }} + runs-on: ${{ matrix.os }} + timeout-minutes: 60 # refs bug #18178 + + steps: + - name: 'Checkout' + uses: actions/checkout@v4 + with: + fetch-depth: 2 + + - name: 'Install build dependencies (macOS)' + if: runner.os == 'macOS' + run: brew install make + + - name: 'Install build dependencies (Windows)' + if: runner.os == 'Windows' + shell: bash + run: | + set -e + . ci/funs.sh + nimInternalInstallDepsWindows + echo "${{ github.workspace }}/dist/mingw64/bin" >> "${GITHUB_PATH}" + + - name: 'Add build binaries to PATH' + shell: bash + run: echo "${{ github.workspace }}/bin" >> "${GITHUB_PATH}" + + - name: 'System information' + shell: bash + run: . ci/funs.sh && nimCiSystemInfo + + - name: 'Build csourcesAny (posix)' + # this would work on windows and other CI use this on windows, + # but we ensure here that `ci/build_autogen.bat` keeps working on windows. + if: runner.os != 'Windows' + shell: bash + run: . ci/funs.sh && nimBuildCsourcesIfNeeded CC=gcc + # was previously using caching via `actions/cache@v1` but this wasn't + # used in other CI pipelines and it's unclear the added complexity + # was worth the saving; can be revisited if needed. + + - name: 'Build csourcesAny (windows)' + if: runner.os == 'Windows' + shell: cmd + run: ci/build_autogen.bat + + - name: 'Build koch' + shell: bash + run: nim c koch + + - name: 'Build the real compiler' + shell: bash + run: ./koch boot -d:release + + - name: 'Build documentation' + shell: bash + run: ./koch doc --git.commit:devel + + - name: 'Publish documentation to Github Pages' + if: | + github.event_name == 'push' && github.ref == 'refs/heads/devel' && + matrix.target == 'linux' + uses: crazy-max/ghaction-github-pages@v4 + with: + build_dir: doc/html + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/ci_gcc14.yml b/.github/workflows/ci_gcc14.yml new file mode 100644 index 000000000..fb286887a --- /dev/null +++ b/.github/workflows/ci_gcc14.yml @@ -0,0 +1,76 @@ +name: GCC 14 +on: + pull_request: + push: + branches: + - 'devel' + + +jobs: + build: + strategy: + fail-fast: false + matrix: + os: [ubuntu-24.04] + cpu: [amd64] + name: '${{ matrix.os }}' + runs-on: ${{ matrix.os }} + timeout-minutes: 60 # refs bug #18178 + steps: + - name: 'Checkout' + uses: actions/checkout@v4 + with: + fetch-depth: 2 + + - name: 'Install node.js 20.x' + uses: actions/setup-node@v4 + with: + node-version: '20.x' + + - name: 'Install dependencies (Linux amd64)' + if: runner.os == 'Linux' && matrix.cpu == 'amd64' + run: | + sudo apt update -qq + sudo apt remove needrestart + DEBIAN_FRONTEND='noninteractive' \ + sudo apt install --no-install-recommends -yq \ + libcurl4-openssl-dev libgc-dev libsdl1.2-dev libsfml-dev \ + valgrind libc6-dbg libblas-dev xorg-dev + - name: 'Install dependencies (Linux amd64 gcc 14)' + if: runner.os == 'Linux' && matrix.cpu == 'amd64' + run: | + sudo add-apt-repository universe + sudo apt update -qq + sudo apt install -y gcc-14 g++-14 libpcre3 liblapack-dev + sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-14 60 --slave /usr/bin/g++ g++ /usr/bin/g++-14 + - name: 'Install dependencies (macOS)' + if: runner.os == 'macOS' + run: brew install boehmgc make sfml gtk+3 + - name: 'Install dependencies (Windows)' + if: runner.os == 'Windows' + shell: bash + run: | + set -e + . ci/funs.sh + nimInternalInstallDepsWindows + echo_run echo "${{ github.workspace }}/dist/mingw64/bin" >> "${GITHUB_PATH}" + + - name: 'Add build binaries to PATH' + shell: bash + run: echo "${{ github.workspace }}/bin" >> "${GITHUB_PATH}" + + - name: 'NIM_TESTAMENT_DISABLE_SSL' + shell: bash + run: echo "NIM_TESTAMENT_DISABLE_SSL=1" >> $GITHUB_ENV + + - name: 'System information' + shell: bash + run: . ci/funs.sh && nimCiSystemInfo + + - name: 'Build csourcesAny' + shell: bash + run: . ci/funs.sh && nimBuildCsourcesIfNeeded CC=gcc ucpu='${{ matrix.cpu }}' + + - name: 'koch, Run CI' + shell: bash + run: . ci/funs.sh && nimInternalBuildKochAndRunCI diff --git a/.github/workflows/ci_packages.yml b/.github/workflows/ci_packages.yml new file mode 100644 index 000000000..2ea5092e3 --- /dev/null +++ b/.github/workflows/ci_packages.yml @@ -0,0 +1,74 @@ +name: Packages CI +on: + pull_request: + push: + branches: + - 'devel' + - 'version-2-0' + - 'version-1-6' + - 'version-1-2' + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + build: + strategy: + fail-fast: false + matrix: + os: [ubuntu-20.04, macos-12] + cpu: [amd64] + batch: ["allowed_failures", "0_3", "1_3", "2_3"] # list of `index_num` + name: '${{ matrix.os }} (batch: ${{ matrix.batch }})' + runs-on: ${{ matrix.os }} + timeout-minutes: 60 # refs bug #18178 + env: + NIM_TEST_PACKAGES: "1" + NIM_TESTAMENT_BATCH: ${{ matrix.batch }} + steps: + - name: 'Checkout' + uses: actions/checkout@v4 + with: + fetch-depth: 2 + + - name: 'Install node.js 20.x' + uses: actions/setup-node@v4 + with: + node-version: '20.x' + + - name: 'Install dependencies (Linux amd64)' + if: runner.os == 'Linux' && matrix.cpu == 'amd64' + run: | + sudo apt-fast update -qq + DEBIAN_FRONTEND='noninteractive' \ + sudo apt-fast install --no-install-recommends -yq \ + libcurl4-openssl-dev libgc-dev libsdl1.2-dev libsfml-dev \ + valgrind libc6-dbg libblas-dev xorg-dev + - name: 'Install dependencies (macOS)' + if: runner.os == 'macOS' + run: brew install boehmgc make sfml gtk+3 + - name: 'Install dependencies (Windows)' + if: runner.os == 'Windows' + shell: bash + run: | + set -e + . ci/funs.sh + nimInternalInstallDepsWindows + echo_run echo "${{ github.workspace }}/dist/mingw64/bin" >> "${GITHUB_PATH}" + + - name: 'Add build binaries to PATH' + shell: bash + run: echo "${{ github.workspace }}/bin" >> "${GITHUB_PATH}" + + - name: 'System information' + shell: bash + run: . ci/funs.sh && nimCiSystemInfo + + - name: 'Build csourcesAny' + shell: bash + run: . ci/funs.sh && nimBuildCsourcesIfNeeded CC=gcc ucpu='${{ matrix.cpu }}' + + - name: 'koch, Run CI' + shell: bash + run: . ci/funs.sh && nimInternalBuildKochAndRunCI diff --git a/.github/workflows/ci_publish.yml b/.github/workflows/ci_publish.yml new file mode 100644 index 000000000..decfe953e --- /dev/null +++ b/.github/workflows/ci_publish.yml @@ -0,0 +1,90 @@ +name: Tracking orc-booting compiler memory usage + +on: + pull_request_target: + types: [closed] + + +jobs: + build: + if: github.event.pull_request.merged == true + strategy: + fail-fast: false + matrix: + os: [ubuntu-20.04] + cpu: [amd64] + name: '${{ matrix.os }}' + runs-on: ${{ matrix.os }} + steps: + - name: 'Checkout' + uses: actions/checkout@v4 + with: + fetch-depth: 2 + + - name: 'Install node.js 20.x' + uses: actions/setup-node@v4 + with: + node-version: '20.x' + + - name: 'Install dependencies (Linux amd64)' + if: runner.os == 'Linux' && matrix.cpu == 'amd64' + run: | + sudo apt-fast update -qq + DEBIAN_FRONTEND='noninteractive' \ + sudo apt-fast install --no-install-recommends -yq \ + libcurl4-openssl-dev libgc-dev libsdl1.2-dev libsfml-dev \ + valgrind libc6-dbg libblas-dev xorg-dev + - name: 'Install dependencies (macOS)' + if: runner.os == 'macOS' + run: brew install boehmgc make sfml gtk+3 + - name: 'Install dependencies (Windows)' + if: runner.os == 'Windows' + shell: bash + run: | + set -e + . ci/funs.sh + nimInternalInstallDepsWindows + echo_run echo "${{ github.workspace }}/dist/mingw64/bin" >> "${GITHUB_PATH}" + + - name: 'Add build binaries to PATH' + shell: bash + run: echo "${{ github.workspace }}/bin" >> "${GITHUB_PATH}" + + - name: 'System information' + shell: bash + run: . ci/funs.sh && nimCiSystemInfo + + - name: 'Build csourcesAny' + shell: bash + run: . ci/funs.sh && nimBuildCsourcesIfNeeded CC=gcc ucpu='${{ matrix.cpu }}' + + - name: 'Build koch' + shell: bash + run: nim c koch + + - name: 'Build Nim' + shell: bash + run: ./koch boot -d:release -d:nimStrictMode --lib:lib + + - name: 'Action' + shell: bash + run: nim c -r -d:release ci/action.nim + + - name: 'Comment' + uses: actions/github-script@v7 + with: + script: | + const fs = require('fs'); + + try { + const data = fs.readFileSync('ci/nimcache/results.txt', 'utf8'); + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: data + }) + } catch (err) { + console.error(err); + } + diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml new file mode 100644 index 000000000..0c5a533e1 --- /dev/null +++ b/.github/workflows/stale.yml @@ -0,0 +1,25 @@ +# https://github.com/actions/stale#usage +name: Stale pull requests + +on: + schedule: + - cron: '0 0 * * *' # Midnight. + +jobs: + stale: + runs-on: ubuntu-latest + steps: + - uses: actions/stale@v9 + with: + days-before-pr-stale: 365 + days-before-pr-close: 30 + days-before-issue-stale: -1 + days-before-issue-close: -1 + exempt-pr-labels: "ARC,bounty,Codegen,Crash,Generics,High Priority,Macros,Next release,Showstopper,Static[T]" + exempt-issue-labels: "Showstopper,Severe,bounty,Compiler Crash,Medium Priority" + stale-pr-message: > + This pull request is stale because it has been open for 1 year with no activity. + Contribute more commits on the pull request and rebase it on the latest devel, + or it will be closed in 30 days. Thank you for your contributions. + close-pr-message: > + This pull request has been marked as stale and closed due to inactivity after 395 days. |