Skip to content
This repository was archived by the owner on Feb 1, 2024. It is now read-only.

[WIP] [CI] Add gitlab ci #317

Open
wants to merge 39 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
3b6ef8d
Add gitlab ci
sergejparity Jul 1, 2022
dc2883f
remove empty lines
sergejparity Jul 1, 2022
151f5f3
add .gitlab-ci.yml to prettier ignore list
sergejparity Jul 1, 2022
c07fd04
add wasm-pack test
sergejparity Jul 1, 2022
45004e8
fix docker-env
sergejparity Jul 1, 2022
973bf2b
add nightly
sergejparity Jul 1, 2022
fac325d
Fix rustup
sergejparity Jul 1, 2022
52ae0cc
Fix deps
sergejparity Jul 1, 2022
4ca9a01
add rust lint and tests
sergejparity Jul 4, 2022
e885070
fix typo
sergejparity Jul 4, 2022
bc45d15
add rust tests
sergejparity Jul 4, 2022
47182cb
remove docker calls
sergejparity Jul 4, 2022
375d2c5
use ink-backend image
sergejparity Jul 4, 2022
74fa04d
add build job
sergejparity Jul 8, 2022
a22d36d
use buildah
sergejparity Jul 8, 2022
e3ffc50
use buildah
sergejparity Jul 8, 2022
362c18e
fix typo use buildah
sergejparity Jul 8, 2022
898bbcc
change tag and image
sergejparity Jul 8, 2022
6a1b182
debug
sergejparity Jul 8, 2022
ab59089
fix format
sergejparity Jul 8, 2022
b545de5
reenable lint
sergejparity Jul 8, 2022
ee3483e
fix tag
sergejparity Jul 8, 2022
1f6d73d
disable tests
sergejparity Jul 8, 2022
4dc33f5
fix
sergejparity Jul 8, 2022
27b9ddd
fix Dockerfile
sergejparity Jul 8, 2022
65e4a18
enable wasm-pack test
sergejparity Aug 12, 2022
7ca5495
fix syntax
sergejparity Aug 12, 2022
6312ae6
add deps install
sergejparity Aug 12, 2022
0b5b1b0
add deps install
sergejparity Aug 12, 2022
4a47cc9
debug
sergejparity Aug 16, 2022
a0b5231
add chromedriver
sergejparity Aug 16, 2022
1c69f3a
wasm-pack test
sergejparity Aug 17, 2022
85feb97
wasm-pack test fix syntax
sergejparity Aug 17, 2022
63c46fe
add quiet option
sergejparity Aug 17, 2022
1302f13
remove redundant commands
sergejparity Aug 17, 2022
1432537
add components and playground test
sergejparity Aug 18, 2022
4b8973e
add rust toolchain
sergejparity Aug 18, 2022
692de02
Merge branch 'main' into sk-add-gitlab-pipeline
sergejparity Oct 7, 2022
e898cc6
Merge branch 'main' into sk-add-gitlab-pipeline
sergejparity Oct 21, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
155 changes: 155 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
# paritytech/ink-playground

stages:
- lint
- test
- publish

default:
retry:
max: 2
when:
- runner_system_failure
- unknown_failure
- api_failure

.rust-info-script: &rust-info-script
- rustup show
- cargo --version
- rustup +nightly show
- cargo +nightly --version
- cargo spellcheck --version
- bash --version
- sccache -s

.kubernetes-env: &kubernetes-env
image: "node:16.15"
tags:
- kubernetes-parity-build

.docker-env: &docker-env
image: "paritytech/ci-linux:production"
before_script:
- *rust-info-script
interruptible: true
tags:
- linux-docker

# Lint
ts-lint:
stage: lint
<<: *kubernetes-env
script:
- make ts-install
- make ts-lint

ts-check-format:
stage: lint
<<: *kubernetes-env
script:
- make ts-install
- make ts-check-format

ts-check-spelling:
stage: lint
<<: *kubernetes-env
script:
- make ts-install
- make ts-check-spelling

rust-check-format:
stage: lint
<<: *docker-env
script:
- cargo +nightly fmt --all -- --check

rust-lint:
stage: lint
<<: *docker-env
script:
- cargo +stable clippy --workspace --exclude rust_analyzer_wasm --exclude contract --all-targets --all-features -- -D warnings

# Test
test-rust-analyzer-wasm:
needs: []
stage: test
<<: *docker-env
script:
- apt update && apt install -y wget
- wget -q https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
- apt install -y ./google-chrome-stable_current_amd64.deb
- CHROME_VERSION=$(google-chrome --version | grep -o -E "[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+")
- CHROME_DRIVER_VERSION=$(curl "https://chromedriver.storage.googleapis.com/LATEST_RELEASE_$CHROME_VERSION")
- wget -q "https://chromedriver.storage.googleapis.com/$CHROME_DRIVER_VERSION/chromedriver_linux64.zip"
- unzip chromedriver_linux64.zip
- mv chromedriver /usr/bin/chromedriver
- chown root:root /usr/bin/chromedriver
- chmod +x /usr/bin/chromedriver
- chromedriver --version
- rustup toolchain install nightly-2022-05-24-x86_64-unknown-linux-gnu
- rustup component add rust-src --toolchain nightly-2022-05-24-x86_64-unknown-linux-gnu
- cargo install wasm-pack
- wasm-pack test --headless --chrome crates/rust_analyzer_wasm

test-components:
needs: []
stage: test
<<: *kubernetes-env
script:
- make ts-install
- make components-test

test-playground:
needs: []
stage: test
<<: *docker-env
script:
- curl -fsSL https://deb.nodesource.com/setup_16.x | bash -
- apt update && apt install -y nodejs
- npm install -y -g yarn
- node -v
- rustup toolchain install nightly-2022-05-24-x86_64-unknown-linux-gnu
- rustup component add rust-src --toolchain nightly-2022-05-24-x86_64-unknown-linux-gnu
- make ts-install
- make generate
- make playground-test

# Publish
build-ink-playground-image:
stage: publish
image: quay.io/buildah/stable
script:
- test "${Docker_Hub_User_Parity}" -a "${Docker_Hub_Pass_Parity}" ||
( echo "no docker credentials provided"; exit 1 )
- buildah bud
--format=docker
--tag ink-playground
- echo "${Docker_Hub_Pass_Parity}" |
buildah login --username "${Docker_Hub_User_Parity}" --password-stdin docker.io
- buildah info
# - buildah push --format=v2s2 "$IMAGE_NAME:$VERSION"
# - buildah push --format=v2s2 "$IMAGE_NAME:$EXTRATAG"
after_script:
- buildah logout --all
tags:
- kubernetes-parity-build

build-ink-backend-image:
stage: publish
image: quay.io/buildah/stable
script:
- test "${Docker_Hub_User_Parity}" -a "${Docker_Hub_Pass_Parity}" ||
( echo "no docker credentials provided"; exit 1 )
- buildah bud
--format=docker
--tag ink-backend
./compiler/.
- echo "${Docker_Hub_Pass_Parity}" |
buildah login --username "${Docker_Hub_User_Parity}" --password-stdin docker.io
- buildah info
# - buildah push --format=v2s2 "$IMAGE_NAME:$VERSION"
# - buildah push --format=v2s2 "$IMAGE_NAME:$EXTRATAG"
after_script:
- buildah logout --all
tags:
- kubernetes-parity-build
3 changes: 2 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ pkg
dist
packages/_generated/*/src/*
bundle-size-stats.json
.yarn
.yarn
.gitlab-ci.yml