|
1 | | -name: CI |
2 | 1 | on: |
3 | 2 | push: |
4 | | - branches: |
5 | | - - master |
6 | 3 | pull_request: |
7 | | - workflow_dispatch: |
| 4 | + schedule: |
| 5 | + - cron: "0 19 * * *" |
8 | 6 |
|
9 | 7 | jobs: |
10 | | - build: |
| 8 | + test: |
11 | 9 | strategy: |
12 | | - fail-fast: false |
13 | 10 | matrix: |
14 | | - target: |
15 | | - - os: linux |
16 | | - cpu: amd64 |
17 | | - - os: linux |
18 | | - cpu: i386 |
19 | | - - os: macos |
20 | | - cpu: amd64 |
21 | | - - os: windows |
22 | | - cpu: amd64 |
23 | | - branch: [version-1-6, devel] |
24 | | - include: |
25 | | - - target: |
26 | | - os: linux |
27 | | - builder: ubuntu-18.04 |
28 | | - shell: bash |
29 | | - - target: |
30 | | - os: macos |
31 | | - builder: macos-10.15 |
32 | | - shell: bash |
33 | | - - target: |
34 | | - os: windows |
35 | | - builder: windows-2019 |
36 | | - shell: msys2 {0} |
37 | | - |
38 | | - defaults: |
39 | | - run: |
40 | | - shell: ${{ matrix.shell }} |
41 | | - |
42 | | - name: '${{ matrix.target.os }}-${{ matrix.target.cpu }} (Nim ${{ matrix.branch }})' |
43 | | - runs-on: ${{ matrix.builder }} |
44 | | - continue-on-error: ${{ matrix.branch == 'version-1-6' || matrix.branch == 'devel' }} |
| 11 | + os: |
| 12 | + # - windows-latest |
| 13 | + # - macos-latest |
| 14 | + - ubuntu-latest |
| 15 | + nimversion: # used for installation |
| 16 | + - 1.6.10 |
| 17 | + nim-version: # actually used |
| 18 | + - devel |
| 19 | + - "#version-1-6" |
| 20 | + name: ${{ matrix.os }} - ${{ matrix.nim-version }} |
| 21 | + runs-on: ${{ matrix.os }} |
| 22 | + env: |
| 23 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
45 | 24 | steps: |
46 | | - - name: Checkout |
47 | | - uses: actions/checkout@v2 |
48 | | - |
49 | | - - name: Install build dependencies (Linux i386) |
50 | | - if: runner.os == 'Linux' && matrix.target.cpu == 'i386' |
51 | | - run: | |
52 | | - sudo dpkg --add-architecture i386 |
53 | | - sudo apt-fast update -qq |
54 | | - sudo DEBIAN_FRONTEND='noninteractive' apt-fast install \ |
55 | | - --no-install-recommends -yq gcc-multilib g++-multilib \ |
56 | | - libssl-dev:i386 |
57 | | - mkdir -p external/bin |
58 | | - cat << EOF > external/bin/gcc |
59 | | - #!/bin/bash |
60 | | - exec $(which gcc) -m32 "\$@" |
61 | | - EOF |
62 | | - cat << EOF > external/bin/g++ |
63 | | - #!/bin/bash |
64 | | - exec $(which g++) -m32 "\$@" |
65 | | - EOF |
66 | | - chmod 755 external/bin/gcc external/bin/g++ |
67 | | - echo '${{ github.workspace }}/external/bin' >> $GITHUB_PATH |
68 | | -
|
69 | | - - name: MSYS2 (Windows i386) |
70 | | - if: runner.os == 'Windows' && matrix.target.cpu == 'i386' |
71 | | - uses: msys2/setup-msys2@v2 |
| 25 | + - uses: actions/checkout@v3 |
| 26 | + - uses: jiro4989/[email protected] |
72 | 27 | with: |
73 | | - path-type: inherit |
74 | | - msystem: MINGW32 |
75 | | - install: >- |
76 | | - base-devel |
77 | | - git |
78 | | - mingw-w64-i686-toolchain |
79 | | -
|
80 | | - - name: MSYS2 (Windows amd64) |
81 | | - if: runner.os == 'Windows' && matrix.target.cpu == 'amd64' |
82 | | - uses: msys2/setup-msys2@v2 |
83 | | - with: |
84 | | - path-type: inherit |
85 | | - install: >- |
86 | | - base-devel |
87 | | - git |
88 | | - mingw-w64-x86_64-toolchain |
89 | | -
|
90 | | - - name: Restore Nim DLLs dependencies (Windows) from cache |
91 | | - if: runner.os == 'Windows' |
92 | | - id: windows-dlls-cache |
93 | | - uses: actions/cache@v2 |
94 | | - with: |
95 | | - path: external/dlls-${{ matrix.target.cpu }} |
96 | | - key: 'dlls-${{ matrix.target.cpu }}' |
97 | | - |
98 | | - - name: Install DLLs dependencies (Windows) |
99 | | - if: > |
100 | | - steps.windows-dlls-cache.outputs.cache-hit != 'true' && |
101 | | - runner.os == 'Windows' |
102 | | - shell: bash |
| 28 | + nim-version: ${{ matrix.nimversion }} |
| 29 | + yes: true |
| 30 | + - name: Install Mercurial on macOS |
| 31 | + if: matrix.os == 'macos-latest' |
| 32 | + run: brew install mercurial |
| 33 | + - name: choosenim ${{ matrix.nim-version }} |
| 34 | + run: choosenim "${{ matrix.nim-version }}" --yes |
| 35 | + - name: Install nimble |
103 | 36 | run: | |
104 | | - mkdir -p external |
105 | | - curl -L "https://nim-lang.org/download/windeps.zip" -o external/windeps.zip |
106 | | - 7z x -y external/windeps.zip -oexternal/dlls-${{ matrix.target.cpu }} |
107 | | -
|
108 | | - - name: Path to cached dependencies (Windows) |
109 | | - if: > |
110 | | - runner.os == 'Windows' |
111 | | - shell: bash |
112 | | - run: | |
113 | | - echo '${{ github.workspace }}'"/external/dlls-${{ matrix.target.cpu }}" >> $GITHUB_PATH |
114 | | -
|
115 | | - - name: Derive environment variables |
116 | | - run: | |
117 | | - if [[ '${{ matrix.target.cpu }}' == 'amd64' ]]; then |
118 | | - PLATFORM=x64 |
119 | | - else |
120 | | - PLATFORM=x86 |
121 | | - fi |
122 | | - echo "PLATFORM=$PLATFORM" >> $GITHUB_ENV |
123 | | -
|
124 | | - ncpu= |
125 | | - MAKE_CMD="make" |
126 | | - case '${{ runner.os }}' in |
127 | | - 'Linux') |
128 | | - ncpu=$(nproc) |
129 | | - ;; |
130 | | - 'macOS') |
131 | | - ncpu=$(sysctl -n hw.ncpu) |
132 | | - ;; |
133 | | - 'Windows') |
134 | | - ncpu=$NUMBER_OF_PROCESSORS |
135 | | - MAKE_CMD="mingw32-make" |
136 | | - ;; |
137 | | - esac |
138 | | - [[ -z "$ncpu" || $ncpu -le 0 ]] && ncpu=1 |
139 | | - echo "ncpu=$ncpu" >> $GITHUB_ENV |
140 | | - echo "MAKE_CMD=${MAKE_CMD}" >> $GITHUB_ENV |
141 | | -
|
142 | | - - name: Build Nim and associated tools |
143 | | - shell: bash |
144 | | - run: | |
145 | | - curl -O -L -s -S https://raw.githubusercontent.com/status-im/nimbus-build-system/master/scripts/build_nim.sh |
146 | | - env MAKE="${MAKE_CMD} -j${ncpu}" ARCH_OVERRIDE=${PLATFORM} NIM_COMMIT=${{ matrix.branch }} \ |
147 | | - QUICK_AND_DIRTY_COMPILER=1 QUICK_AND_DIRTY_NIMBLE=1 CC=gcc \ |
148 | | - bash build_nim.sh nim csources dist/nimble NimBinaries |
149 | | - echo '${{ github.workspace }}/nim/bin' >> $GITHUB_PATH |
150 | | -
|
151 | | - - name: Run tests |
| 37 | + git clone https://github.com/yyoncho/nimble -b nim-as-dep |
| 38 | + cd nimble |
| 39 | + nimble -y build |
| 40 | + # - name: install deps |
| 41 | + # shell: bash |
| 42 | + # run: | |
| 43 | + # ./nimble/nimble -y install |
| 44 | + - name: test |
152 | 45 | shell: bash |
153 | 46 | run: | |
154 | | - if [[ "${{ matrix.target.os }}" == "windows" ]]; then |
155 | | - # https://github.com/status-im/nimbus-eth2/issues/3121 |
156 | | - export NIMFLAGS="-d:nimRawSetjmp" |
157 | | - fi |
158 | | - nim --version |
159 | | - nimble --version |
160 | | - nimble install -y --depsOnly |
161 | | - env TEST_LANG="c" nimble test |
162 | | - # C++ is unsupported: https://github.com/status-im/nim-json-rpc/issues/119 |
163 | | - #env TEST_LANG="cpp" nimble test |
| 47 | + ./nimble/nimble -y test |
0 commit comments