Skip to content
Snippets Groups Projects
Unverified Commit cec49d50 authored by Yorick Peterse's avatar Yorick Peterse
Browse files

Refactor CI config and add Windows support

This splits up the CI configuration into separate files, and adds
support for running the tests and releases on Windows. Tests are no
longer run on Rust nightly, as this does not add any value to the test
suite (any more).
parent f51e6a2a
No related branches found
No related tags found
No related merge requests found
---
variables:
CARGO_HOME: $CI_PROJECT_DIR/.cargo
DEBIAN_FRONTEND: noninteractive
AWS_REGION: eu-west-1
# Ensure Windows builds fail when Powershell detects an error.
ErrorActionPreference: 'STOP'
 
stages:
- test
- build
- test-runtime
- release
- post-release
 
dependency_scanning:
image: registry.gitlab.com/inko-lang/development-docker-images:cargo-audit
stage: test
before_script:
- cargo --version
- rustc --version
- ruby --version
script:
- ./scripts/audit.rb
artifacts:
when: always
expire_in: 1 month
reports:
dependency_scanning: gl-dependency-scanning-report.json
paths:
- gl-dependency-scanning-report.json
allow_failure: true
cache:
key: cargo-audit
paths:
- .cargo
test:compiler:linux:
image: registry.gitlab.com/inko-lang/development-docker-images:alpine
stage: test
before_script:
- cd compiler
- ruby --version
- gem --version
- bundle --version
- bundle install --path vendor --retry=3
script:
- make test
cache:
paths:
- compiler/vendor/ruby
test:compiler:macos:
stage: test
tags:
- macos
before_script:
- cd compiler
- ruby --version
- gem --version
- bundle --version
- bundle install --path vendor --retry=3
script:
- gmake test
cache:
key: macos
paths:
- compiler/vendor/ruby
test:ivm-nightly:linux:
image: registry.gitlab.com/inko-lang/development-docker-images:rust-nightly
stage: test
before_script:
- cd vm
- rustc --version
- cargo --version
script:
- make test
cache:
paths:
- .cargo
- vm/target
test:ivm-stable:linux:
image: registry.gitlab.com/inko-lang/development-docker-images:alpine
stage: test
before_script:
- cd vm
- rustc --version
- cargo --version
script:
- make test
cache:
paths:
- .cargo
- vm/target
test:ivm-nightly:macos:
stage: test
tags:
- macos
before_script:
- cd vm
- rustc --version
- cargo --version
script:
- rustup run nightly gmake test
cache:
key: macos
paths:
- .cargo
- vm/target
test:ivm-stable:macos:
stage: test
tags:
- macos
before_script:
- cd vm
- rustc --version
- cargo --version
script:
- gmake test
cache:
key: macos
paths:
- .cargo
- vm/target
lint:clippy:
image: registry.gitlab.com/inko-lang/development-docker-images:rust-stable
stage: test
before_script:
- cd vm
- rustc --version
- cargo --version
script:
- make clippy
cache:
paths:
- .cargo
- vm/target
lint:rustfmt:
image: registry.gitlab.com/inko-lang/development-docker-images:rust-stable
stage: test
before_script:
- cd vm
- rustc --version
- cargo --version
- rustfmt --version
script:
- make rustfmt-check
lint:versions:
image: registry.gitlab.com/inko-lang/development-docker-images:alpine
stage: test
script:
- bash scripts/versions.sh
build:ivm:linux:
image: registry.gitlab.com/inko-lang/development-docker-images:alpine
stage: build
before_script:
- cd vm
- rustc --version
- cargo --version
script:
- make release
- mv target/release/ivm ../ivm
- strip ../ivm
cache:
paths:
- .cargo
- vm/target
artifacts:
expire_in: 1 hour
paths:
- ivm
build:ivm:macos:
stage: build
tags:
- macos
before_script:
- cd vm
- rustc --version
- cargo --version
script:
- gmake release
- mv target/release/ivm ../ivm
- strip ../ivm
cache:
key: macos
paths:
- .cargo
- vm/target
artifacts:
expire_in: 1 hour
paths:
- ivm
test:runtime:linux:
image: registry.gitlab.com/inko-lang/development-docker-images:alpine
stage: test-runtime
before_script:
- ruby --version
- ./ivm --version
- ./ivm --features
script:
- env RUBYLIB=./compiler/lib ./compiler/bin/inko-test -d runtime --vm ./ivm
dependencies:
- build:ivm:linux
test:runtime:macos:
stage: test-runtime
tags:
- macos
before_script:
- ruby --version
- ./ivm --version
- ./ivm --features
script:
- env RUBYLIB=./compiler/lib ./compiler/bin/inko-test -d runtime --vm ./ivm
dependencies:
- build:ivm:macos
release:source:
image: registry.gitlab.com/inko-lang/development-docker-images:alpine
stage: release
script:
- make release-source
only:
- tags
release:compiled:linux-gnu:
image: registry.gitlab.com/inko-lang/development-docker-images:rust-stable
stage: release
before_script:
- ruby --version
- rustc --version
- cargo --version
- aws --version
script:
- make release-compiled
only:
- tags
cache:
paths:
- .cargo
- vm/target
release:compiled:macos:
stage: release
tags:
- macos
before_script:
- ruby --version
- rustc --version
- cargo --version
- aws --version
script:
- gmake release-compiled SHA256SUM=gsha256sum
only:
- tags
cache:
key: macos
paths:
- .cargo
- vm/target
post-release:manifest:
image: registry.gitlab.com/inko-lang/development-docker-images:alpine
stage: post-release
script:
- make rebuild-manifest
only:
- tags
include:
- local: .gitlab/ci/windows.yml
- local: .gitlab/ci/macos.yml
- local: .gitlab/ci/linux.yml
- local: .gitlab/ci/lints.yml
- local: .gitlab/ci/releases.yml
---
dependency_scanning:
image: registry.gitlab.com/inko-lang/development-docker-images:cargo-audit
stage: test
before_script:
- cargo --version
- rustc --version
- ruby --version
script:
- ./scripts/audit.rb
artifacts:
when: always
expire_in: 1 day
reports:
dependency_scanning: gl-dependency-scanning-report.json
paths:
- gl-dependency-scanning-report.json
allow_failure: true
lint:clippy:
image: registry.gitlab.com/inko-lang/development-docker-images:rust-stable
stage: test
before_script:
- cd vm
- rustc --version
- cargo --version
script:
- make clippy
cache:
paths:
- .cargo
- vm/target
lint:rustfmt:
image: registry.gitlab.com/inko-lang/development-docker-images:rust-stable
stage: test
before_script:
- cd vm
- rustc --version
- cargo --version
- rustfmt --version
script:
- make rustfmt-check
lint:versions:
image: registry.gitlab.com/inko-lang/development-docker-images:alpine
stage: test
script:
- bash scripts/versions.sh
---
test:compiler:linux:
image: registry.gitlab.com/inko-lang/development-docker-images:alpine
stage: test
before_script:
- cd compiler
- ruby --version
- gem --version
- bundle --version
- bundle install --path vendor --retry=3
script:
- make test
cache:
paths:
- compiler/vendor/ruby
test:ivm:linux:
image: registry.gitlab.com/inko-lang/development-docker-images:alpine
stage: test
before_script:
- cd vm
- rustc --version
- cargo --version
script:
- make test
cache:
paths:
- .cargo
- vm/target
test:runtime:linux:
image: registry.gitlab.com/inko-lang/development-docker-images:alpine
stage: test-runtime
before_script:
- ruby --version
- rustc --version
- cargo --version
script:
- make -C vm release
- env RUBYLIB=./compiler/lib ./compiler/bin/inko-test -d runtime --vm ./vm/target/release/ivm
cache:
paths:
- .cargo
- vm/target
release:compiled:linux-gnu:
image: registry.gitlab.com/inko-lang/development-docker-images:rust-stable
stage: release
before_script:
- ruby --version
- rustc --version
- cargo --version
- aws --version
script:
- make release-compiled
only:
- tags
cache:
paths:
- .cargo
- vm/target
---
test:compiler:macos:
stage: test
tags:
- macos
before_script:
- cd compiler
- ruby --version
- gem --version
- bundle --version
- bundle install --path vendor --retry=3
script:
- gmake test
cache:
key: macos
paths:
- compiler/vendor/ruby
test:ivm:macos:
stage: test
tags:
- macos
before_script:
- cd vm
- rustc --version
- cargo --version
script:
- gmake test
cache:
key: macos
paths:
- .cargo
- vm/target
test:runtime:macos:
stage: test-runtime
tags:
- macos
before_script:
- ruby --version
- rustc --version
- cargo --version
script:
- gmake -C vm release
- env RUBYLIB=./compiler/lib ./compiler/bin/inko-test -d runtime --vm ./vm/target/release/ivm
cache:
key: macos
paths:
- .cargo
- vm/target
release:compiled:macos:
stage: release
tags:
- macos
before_script:
- ruby --version
- rustc --version
- cargo --version
- aws --version
script:
- gmake release-compiled SHA256SUM=gsha256sum
only:
- tags
cache:
key: macos
paths:
- .cargo
- vm/target
---
release:source:
image: registry.gitlab.com/inko-lang/development-docker-images:alpine
stage: release
script:
- make release-source
only:
- tags
post-release:manifest:
image: registry.gitlab.com/inko-lang/development-docker-images:alpine
stage: post-release
script:
- make rebuild-manifest
only:
- tags
---
test:compiler:windows:
stage: test
tags:
- windows
before_script:
- cd compiler
- ruby --version
- gem --version
- bundle --version
- bundle install --path vendor --retry=3
script:
- C:/msys make test
cache:
key: windows
paths:
- compiler/vendor/ruby
test:ivm:windows:
image: windows:1809
stage: test
tags:
- windows
before_script:
- cd vm
- rustc --version
- cargo --version
script:
- C:/msys make test
cache:
key: windows
paths:
- .cargo
- vm/target
test:runtime:windows:
stage: test-runtime
tags:
- windows
before_script:
- ruby --version
- rustc --version
- cargo --version
script:
- C:/msys make -C vm release
- ruby -I ./compiler/lib ./compiler/bin/inko-test -d runtime --vm ./vm/target/release/ivm.exe
cache:
key: windows
paths:
- .cargo
- vm/target
release:compiled:windows:
stage: release
tags:
- windows
before_script:
- ruby --version
- rustc --version
- cargo --version
- C:/msys aws --version
script:
- C:/msys make release-compiled
only:
- tags
cache:
key: windows
paths:
- .cargo
- vm/target
---
image: Visual Studio 2017
build: off
version: '{build}'
platform:
- x64
notifications:
- provider: Email
on_build_success: false
on_build_failure: false
on_build_status_changed: false
environment:
matrix:
- TARGET: x86_64-pc-windows-gnu
CHANNEL: nightly
- TARGET: x86_64-pc-windows-gnu
CHANNEL: stable
install:
- curl -sSf -o rustup-init.exe https://win.rustup.rs
- rustup-init.exe --default-host %TARGET% --default-toolchain %CHANNEL% -y
- set PATH=C:\Users\appveyor\.cargo\bin;%PATH%
- set PATH=C:\Ruby24-x64\bin;%PATH%
- set PATH=C:\Python37-x64;%PATH%
- set PATH=C:\msys64\usr\bin;%PATH%
# Install dependencies for FFI.
- C:\msys64\usr\bin\bash -lc "pacman --noconfirm -S automake autoconf texinfo clang"
# Install the dependencies of the compiler.
- cd compiler
- bundle install --path vendor --retry=3
- cd ..
cache:
- C:\Users\appveyor\.cargo
- compiler\vendor
- vm\target
before_test:
- rustc --version
- cargo --version
- ruby --version
test_script:
- C:\msys64\usr\bin\env MSYSTEM=MINGW64 C:\msys64\usr\bin\bash -l %APPVEYOR_BUILD_FOLDER%\scripts\appveyor.sh
#!/usr/bin/env bash
set -e
cd "$APPVEYOR_BUILD_FOLDER" || exit 1
echo 'Running compiler tests...'
make -C compiler test
echo 'Running VM tests...'
make -C vm test
echo 'Building the VM...'
make -C vm release
# Run the runtime tests
ruby -I ./compiler/lib ./compiler/bin/inko-test -d runtime \
--vm vm/target/release/ivm
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment