-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
83 lines (77 loc) · 3.17 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# Copyright © 2021 Jeremy Carter <[email protected]>
#
# By using this software, you agree to the LICENSE TERMS
# outlined in the file titled LICENSE.md contained in the
# top-level directory of this project. If you don't agree
# to the LICENSE TERMS, you aren't allowed to use this
# software.
# The GitLab CI/CD pipeline configuration lives in this
# file.
image: "rust:latest"
# NOTE: Install some compilers and build tools if necessary.
# You may need this if your project depends on C code.
# before_script:
# - apt-get update
# - apt-get install -y build-essential
# These are the GitLab CI/CD pipeline stages we want to run.
stages:
# - test
# - docs
- debug-linux-x86_64
- debug-windows-x86_64
- release-linux-x86_64
- release-windows-x86_64
# - deploy
# Pipeline "debug-linux-x86_64" stage - Use cargo to build the Linux x86_64 debug binary for this project.
debug-linux-x86_64:
stage: debug-linux-x86_64
timeout: 3h
needs: # Wait for a previous stage to finish before running this stage.
[]
# "test",
script:
- sudo apt-get update && sudo apt-get upgrade -y && sudo apt-get dist-upgrade -y && sudo apt-get autoremove -y # Install OS updates.
- rustc --version && cargo --version # Display rustc and cargo versions.
- RUST_BACKTRACE=full cargo build --verbose
- mkdir -p rust-playground-api
- cp target/debug/main rust-playground-api/rust-playground-api
- cp gist.sh asm-gist.sh build-gist.sh run-gist.sh test-gist.sh wasm-gist.sh rust-playground-api/
- chmod 755 rust-playground-api/rust-playground-api
artifacts:
name: rust-playground-api-debug-linux-x86_64
# expire_in: never # Keep this stage's output artifacts forever.
paths: # The files found at these paths will be added to the artifacts archive for this pipeline stage.
- rust-playground-api
# Pipeline "release-linux-x86_64" stage - Use cargo to build the Linux x86_64 release binary for this project.
release-linux-x86_64:
stage: release-linux-x86_64
timeout: 3h
needs: # Wait for a previous stage to finish before running this stage.
[]
# "test",
script:
- sudo apt-get update && sudo apt-get upgrade -y && sudo apt-get dist-upgrade -y && sudo apt-get autoremove -y # Install OS updates.
- rustc --version && cargo --version # Display rustc and cargo versions.
- RUST_BACKTRACE=full cargo build --release --verbose
- mkdir -p rust-playground-api
- cp target/release/main rust-playground-api/rust-playground-api
- cp gist.sh asm-gist.sh build-gist.sh run-gist.sh test-gist.sh wasm-gist.sh rust-playground-api/
- strip -s rust-playground-api/rust-playground-api
- chmod 755 rust-playground-api/rust-playground-api
artifacts:
name: rust-playground-api-release-linux-x86_64
# expire_in: never # Keep this stage's output artifacts forever.
paths: # The files found at these paths will be added to the artifacts archive for this pipeline stage.
- rust-playground-api
# pages:
# stage: deploy
# needs: # Wait for a previous stage to finish before running this stage.
# []
# script:
# - echo 'Nothing to do...'
# artifacts:
# paths:
# - public
# expire_in: 1 day
# only:
# - master