-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: use Nimble to manage Nim #222
Open
romanzac
wants to merge
23
commits into
master
Choose a base branch
from
test-with-nightly-nimble
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
412af51
test: install latest Nimble then Nim
romanzac cdce6ef
fix: branch name in wf
romanzac e7af41c
fix: add path to Nim to env
romanzac 0d37f83
fix: syntax for writing to GITHUB_PATH
romanzac b845928
fix: check GITHUB_PATH
romanzac baecada
fix: debug GITHUB_PATH
romanzac a028518
fix: check nin file exists
romanzac ca27bb2
test: check versions only
romanzac de03d15
test: reduce to path info
romanzac db92cae
fix: syntax err
romanzac 6cb6459
test: version on absolute path
romanzac c509c77
test: version on relative path
romanzac 8c2f640
test: nimble version on relative path
romanzac 4f2dc3a
fix: nimble version on relative path
romanzac 167c4b5
fix: nim path output
romanzac 9bcb7a3
test: switch to Nimble setup
romanzac 4c2b5da
test: update PATH
romanzac f60a68f
test: install old Nim 1.6.20
romanzac 8949215
test: install the newest Nim 2.1.1
romanzac 5331b20
test: install older 1.6 with partial version
romanzac a8887e5
test: time Nim installation
romanzac f65376b
test: time Nimble setup installation
romanzac 2e76537
Merge branch 'master' into test-with-nightly-nimble
romanzac File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,156 @@ | ||
name: Test with latest Nimble | ||
on: | ||
push: | ||
branches: | ||
- test-with-nightly-nimble | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
concurrency: # Cancel stale PR builds (but not push builds) | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
target: | ||
- os: linux | ||
cpu: amd64 | ||
branch: [devel] | ||
include: | ||
- target: | ||
os: linux | ||
builder: ubuntu-latest | ||
shell: bash | ||
|
||
defaults: | ||
run: | ||
shell: ${{ matrix.shell }} | ||
|
||
name: '${{ matrix.target.os }}-${{ matrix.target.cpu }} (Nim ${{ matrix.branch }})' | ||
runs-on: ${{ matrix.builder }} | ||
continue-on-error: ${{ matrix.branch == 'devel' }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install build dependencies (Linux i386) | ||
if: runner.os == 'Linux' && matrix.target.cpu == 'i386' | ||
run: | | ||
sudo dpkg --add-architecture i386 | ||
sudo apt-fast update -qq | ||
sudo DEBIAN_FRONTEND='noninteractive' apt-fast install \ | ||
--no-install-recommends -yq gcc-multilib g++-multilib \ | ||
libssl-dev:i386 | ||
mkdir -p external/bin | ||
cat << EOF > external/bin/gcc | ||
#!/bin/bash | ||
exec $(which gcc) -m32 "\$@" | ||
EOF | ||
cat << EOF > external/bin/g++ | ||
#!/bin/bash | ||
exec $(which g++) -m32 "\$@" | ||
EOF | ||
chmod 755 external/bin/gcc external/bin/g++ | ||
echo '${{ github.workspace }}/external/bin' >> $GITHUB_PATH | ||
|
||
- name: 'Install dependencies (macOS)' | ||
if: runner.os == 'macOS' && matrix.branch == 'devel' | ||
run: | | ||
brew install [email protected] | ||
ln -s $(brew --prefix)/opt/openssl/lib/libcrypto.1.1.dylib /usr/local/lib | ||
ln -s $(brew --prefix)/opt/openssl/lib/libssl.1.1.dylib /usr/local/lib/ | ||
|
||
- name: MSYS2 (Windows i386) | ||
if: runner.os == 'Windows' && matrix.target.cpu == 'i386' | ||
uses: msys2/setup-msys2@v2 | ||
with: | ||
path-type: inherit | ||
msystem: MINGW32 | ||
install: >- | ||
base-devel | ||
git | ||
mingw-w64-i686-toolchain | ||
|
||
- name: MSYS2 (Windows amd64) | ||
if: runner.os == 'Windows' && matrix.target.cpu == 'amd64' | ||
uses: msys2/setup-msys2@v2 | ||
with: | ||
path-type: inherit | ||
install: >- | ||
base-devel | ||
git | ||
mingw-w64-x86_64-toolchain | ||
|
||
- name: Restore Nim DLLs dependencies (Windows) from cache | ||
if: runner.os == 'Windows' | ||
id: windows-dlls-cache | ||
uses: actions/cache@v4 | ||
with: | ||
path: external/dlls-${{ matrix.target.cpu }} | ||
key: 'dlls-${{ matrix.target.cpu }}' | ||
|
||
- name: Install DLLs dependencies (Windows) | ||
if: > | ||
steps.windows-dlls-cache.outputs.cache-hit != 'true' && | ||
runner.os == 'Windows' | ||
run: | | ||
mkdir -p external | ||
curl -L "https://nim-lang.org/download/windeps.zip" -o external/windeps.zip | ||
7z x -y external/windeps.zip -oexternal/dlls-${{ matrix.target.cpu }} | ||
|
||
- name: Path to cached dependencies (Windows) | ||
if: > | ||
runner.os == 'Windows' | ||
run: | | ||
echo "${{ github.workspace }}/external/dlls-${{ matrix.target.cpu }}" >> $GITHUB_PATH | ||
|
||
- name: Derive environment variables | ||
run: | | ||
if [[ '${{ matrix.target.cpu }}' == 'amd64' ]]; then | ||
PLATFORM=x64 | ||
else | ||
PLATFORM=x86 | ||
fi | ||
echo "PLATFORM=$PLATFORM" >> $GITHUB_ENV | ||
|
||
ncpu= | ||
MAKE_CMD="make" | ||
case '${{ runner.os }}' in | ||
'Linux') | ||
ncpu=$(nproc) | ||
;; | ||
'macOS') | ||
ncpu=$(sysctl -n hw.ncpu) | ||
;; | ||
'Windows') | ||
ncpu=$NUMBER_OF_PROCESSORS | ||
MAKE_CMD="mingw32-make" | ||
;; | ||
esac | ||
[[ -z "$ncpu" || $ncpu -le 0 ]] && ncpu=1 | ||
echo "ncpu=$ncpu" >> $GITHUB_ENV | ||
echo "MAKE_CMD=${MAKE_CMD}" >> $GITHUB_ENV | ||
|
||
- name: Download Nimble and install Nim | ||
run: | | ||
start=$(date +%s) | ||
curl -O -L -s -S https://github.com/nim-lang/nimble/releases/download/latest/nimble-linux_x64.tar.gz | ||
end=$(date +%s) | ||
echo "Nimble download took: $(($end-$start)) seconds" | ||
tar xvfz nimble-linux_x64.tar.gz | ||
start=$(date +%s) | ||
./nimble setup | ||
end=$(date +%s) | ||
echo "Nimble setup took: $(($end-$start)) seconds" | ||
echo $(./nimble path nim | tail -n 1)/bin >> $GITHUB_PATH | ||
|
||
- name: Run tests | ||
run: | | ||
nim --version | ||
nimble --version | ||
rm -f nimble.lock | ||
env NIMLANG=c nimble test | ||
env NIMLANG=cpp nimble test |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these make sections are not needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aren't they needed for Windows ?
Right now this PR is only to test and collect information. In the test report, there is only one passing combination - Test01. When Nimble installs Nim 2.0 and Nimble 0.14.2.