Mentions légales du service

Skip to content
Snippets Groups Projects

Fix #4: add Windows and Mac OS runners

Merged Thierry Martinez requested to merge fix.4.windows_and_macos into main
5 files
+ 278
24
Compare changes
  • Side-by-side
  • Inline
Files
5
+ 55
9
@@ -16,8 +16,9 @@ stages:
- execute
- cleanup
before_script:
- cp $SSH_PRIVATE_KEY id_rsa
.with-rsa-key:
before_script:
- cp $SSH_PRIVATE_KEY id_rsa
fmt:
tags:
@@ -29,13 +30,17 @@ validate:
tags:
- linux
- small
extends: .terraform:validate
extends:
- .terraform:validate
- .with-rsa-key
build:
tags:
- linux
- small
extends: .terraform:build
extends:
- .terraform:build
- .with-rsa-key
environment:
name: $TF_STATE_NAME
@@ -43,23 +48,64 @@ deploy:
tags:
- linux
- small
extends: .terraform:deploy
extends:
- .terraform:deploy
- .with-rsa-key
dependencies:
- build
rules:
- when: manual
execute:
execute linux:
stage: execute
image: alpine
tags:
- terraform
- docker
script:
- echo Greetings from runner!
- apk add gcc musl-dev
- gcc -o hello_world.linux hello_world.c
artifacts:
paths:
- hello_world.linux
execute windows:
stage: execute
image: alpine
tags:
- terraform
- windows
script:
# The trick for running cmd scripts from powershell runner is documented
# here:
# https://gitlab.com/guided-explorations/microsoft/windows/call-cmd-from-powershell/-/blob/master/.gitlab-ci.yml
- |
set-content $env:public\inline.cmd -Value @'
call "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat"
cl /Fe:hello_world.exe hello_world.c
'@
CMD.EXE /C $env:public\inline.cmd
exit $LASTEXITCODE
artifacts:
paths:
- hello_world.exe
execute macos:
stage: execute
image: alpine
tags:
- terraform
- macos
script:
- clang -o hello_world.macos hello_world.c
artifacts:
paths:
- hello_world.macos
destroy:
tags:
- linux
- small
extends: .terraform:destroy
extends:
- .terraform:destroy
- .with-rsa-key
Loading