diff options
Diffstat (limited to '.github/workflows/ci_docs.yml')
-rw-r--r-- | .github/workflows/ci_docs.yml | 91 |
1 files changed, 33 insertions, 58 deletions
diff --git a/.github/workflows/ci_docs.yml b/.github/workflows/ci_docs.yml index 22d425b10..2faa37ce0 100644 --- a/.github/workflows/ci_docs.yml +++ b/.github/workflows/ci_docs.yml @@ -2,10 +2,10 @@ name: Nim Docs CI on: push: paths: - - 'compiler/docgen.nim' - - 'compiler/renderverbatim.nim' + - 'compiler/**.nim' - 'config/nimdoc.cfg' - 'doc/**.rst' + - 'doc/**.md' - 'doc/nimdoc.css' - 'lib/**.nim' - 'nimdoc/testproject/expected/testproject.html' @@ -13,13 +13,14 @@ on: - 'tools/kochdocs.nim' - '.github/workflows/ci_docs.yml' - 'koch.nim' + pull_request: # Run only on changes on these files. paths: - - 'compiler/docgen.nim' - - 'compiler/renderverbatim.nim' + - 'compiler/**.nim' - 'config/nimdoc.cfg' - 'doc/**.rst' + - 'doc/**.md' - 'doc/nimdoc.css' - 'lib/**.nim' - 'nimdoc/testproject/expected/testproject.html' @@ -28,28 +29,33 @@ on: - '.github/workflows/ci_docs.yml' - 'koch.nim' +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + jobs: build: - if: | - !contains(format('{0} {1}', github.event.head_commit.message, github.event.pull_request.title), '[skip ci]') strategy: fail-fast: false matrix: target: [linux, windows, osx] include: - target: linux - os: ubuntu-18.04 + os: ubuntu-20.04 - target: windows os: windows-2019 - target: osx - os: macos-10.15 + os: macos-12 name: ${{ matrix.target }} runs-on: ${{ matrix.os }} + timeout-minutes: 60 # refs bug #18178 steps: - name: 'Checkout' - uses: actions/checkout@v2 + uses: actions/checkout@v4 + with: + fetch-depth: 2 - name: 'Install build dependencies (macOS)' if: runner.os == 'macOS' @@ -59,64 +65,33 @@ jobs: if: runner.os == 'Windows' shell: bash run: | - mkdir dist - curl -L https://nim-lang.org/download/mingw64.7z -o dist/mingw64.7z - curl -L https://nim-lang.org/download/dlls.zip -o dist/dlls.zip - 7z x dist/mingw64.7z -odist - 7z x dist/dlls.zip -obin + 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: 'Get current csources version' - id: csources-version + - name: 'System information' shell: bash - run: | - sha=$(git ls-remote https://github.com/nim-lang/csources master | cut -f 1) - echo "::set-output name=sha::$sha" - - - name: 'Get prebuilt csources from cache' - id: csources-cache - uses: actions/cache@v1 - with: - path: bin - key: '${{ matrix.os }}-${{ steps.csources-version.outputs.sha }}' - - - name: 'Checkout csources' - if: steps.csources-cache.outputs.cache-hit != 'true' - uses: actions/checkout@v2 - with: - repository: nim-lang/csources - path: csources + run: . ci/funs.sh && nimCiSystemInfo - - name: 'Build 1-stage compiler from csources' + - 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: | - ext= - [[ '${{ runner.os }}' == 'Windows' ]] && ext=.exe - if [[ ! -x bin/nim-csources$ext ]]; then - ncpu= - case '${{ runner.os }}' in - 'Linux') - ncpu=$(nproc) - ;; - 'macOS') - ncpu=$(sysctl -n hw.ncpu) - ;; - 'Windows') - ncpu=$NUMBER_OF_PROCESSORS - ;; - esac - [[ -z "$ncpu" || $ncpu -le 0 ]] && ncpu=1 + 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. - make -C csources -j $ncpu CC=gcc - cp bin/nim{,-csources}$ext - else - echo 'Cache hit, using prebuilt csources' - cp bin/nim{-csources,}$ext - fi + - name: 'Build csourcesAny (windows)' + if: runner.os == 'Windows' + shell: cmd + run: ci/build_autogen.bat - name: 'Build koch' shell: bash @@ -134,7 +109,7 @@ jobs: if: | github.event_name == 'push' && github.ref == 'refs/heads/devel' && matrix.target == 'linux' - uses: crazy-max/ghaction-github-pages@v1 + uses: crazy-max/ghaction-github-pages@v4 with: build_dir: doc/html env: |