Skip to content

Commit

Permalink
Refactor actions ci. (#58)
Browse files Browse the repository at this point in the history
* Initial commit.

* Fix nim_branch.

* Fix bootstrap scripts.

* Fix git checkout.

* Add compiler's version dump.

* Add schedule job every day at 22:25 UTC.

* Change schedule to 23:00 UTC.

* Fix issue.

* Attempt to fix cron issue.

* Fix pull_request.

* Recover.

* Revert to previous version.
  • Loading branch information
cheatfate committed Jul 5, 2022
1 parent b41129f commit 24e006d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 43 deletions.
51 changes: 10 additions & 41 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,49 +11,15 @@ jobs:
target:
- os: linux
cpu: amd64
nim_branch: devel
- os: linux
cpu: amd64
nim_branch: v1.2.12
- os: linux
cpu: amd64
nim_branch: v1.0.10
- os: linux
cpu: i386
nim_branch: devel
- os: linux
cpu: i386
nim_branch: v1.2.12
- os: linux
cpu: i386
nim_branch: v1.0.10
- os: macos
cpu: amd64
nim_branch: devel
- os: macos
cpu: amd64
nim_branch: v1.2.12
- os: macos
cpu: amd64
nim_branch: v1.0.10
- os: windows
cpu: amd64
nim_branch: devel
- os: windows
cpu: amd64
nim_branch: v1.2.12
- os: windows
cpu: amd64
nim_branch: v1.0.10
- os: windows
cpu: i386
nim_branch: devel
- os: windows
cpu: i386
nim_branch: v1.2.12
- os: windows
cpu: i386
nim_branch: v1.0.10
nim_branch: [version-1-0, version-1-2, version-1-4, version-1-6, devel]
include:
- target:
os: linux
Expand All @@ -65,11 +31,11 @@ jobs:
os: windows
builder: windows-2019

name: '${{ matrix.target.os }}-${{ matrix.target.cpu }}-nim-${{ matrix.target.nim_branch }} (${{ matrix.branch }})'
name: '${{ matrix.target.os }}-${{ matrix.target.cpu }}-nim-${{ matrix.nim_branch }} (${{ matrix.branch }})'
runs-on: ${{ matrix.builder }}
env:
NIM_DIR: nim-${{ matrix.target.nim_branch }}-${{ matrix.target.cpu }}
NIM_BRANCH: ${{ matrix.target.nim_branch }}
NIM_DIR: nim-${{ matrix.nim_branch }}-${{ matrix.target.cpu }}
NIM_BRANCH: ${{ matrix.nim_branch }}
NIM_ARCH: ${{ matrix.target.cpu }}
steps:
- name: Checkout nimcrypto
Expand Down Expand Up @@ -133,12 +99,12 @@ jobs:
- name: Restore Nim from cache
if: >
steps.nim-compiler-cache.outputs.cache-hit != 'true' &&
matrix.target.nim_branch != 'devel'
matrix.nim_branch != 'devel'
id: nim-compiler-cache
uses: actions/cache@v2
with:
path: '${{ github.workspace }}/nim-${{ matrix.target.nim_branch }}-${{ matrix.target.cpu }}'
key: 'nim-${{ matrix.target.cpu }}-${{ matrix.target.nim_branch }}'
path: '${{ github.workspace }}/nim-${{ matrix.nim_branch }}-${{ matrix.target.cpu }}'
key: 'nim-${{ matrix.target.cpu }}-${{ matrix.nim_branch }}'

- name: Build Nim and associated tools
shell: bash
Expand All @@ -160,5 +126,8 @@ jobs:
shell: bash
working-directory: nimcrypto
run: |
gcc --version
nim --version
nimble --version
nimble install -y
nimble test
2 changes: 1 addition & 1 deletion tests/bootstrap.bat
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ ECHO Building Nim [%NIM_BRANCH%] (%NIM_ARCH%) in %NIM_DIR%
git clone https://github.com/nim-lang/Nim.git "%CD%\%NIM_DIR%"
CD "%CD%\%NIM_DIR%"
IF NOT "%NIM_BRANCH%" == "devel" (
git checkout "tags/%NIM_BRANCH%" -b "%NIM_BRANCH%"
git checkout "%NIM_BRANCH%"
) ELSE (
git checkout devel
)
Expand Down
2 changes: 1 addition & 1 deletion tests/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function build_nim {
if [ "${NIM_BRANCH}" = "devel" ]; then
git checkout devel
else
git checkout "tags/${NIM_BRANCH}" -b "${NIM_BRANCH}"
git checkout "${NIM_BRANCH}"
fi
git clone --depth 1 https://github.com/nim-lang/csources_v1
cd csources_v1 && sh build.sh
Expand Down

0 comments on commit 24e006d

Please sign in to comment.