Skip to content
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

Switch from Arch Linux to Alpine for Cirrus CI #34

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
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
36 changes: 21 additions & 15 deletions .cirrus.yaml
Original file line number Diff line number Diff line change
@@ -1,26 +1,29 @@
os_setup: &os_setup
env:
CI_IMAGE: alpine:3
container:
image: archlinux
image: $CI_IMAGE
os_setup_script:
- pacman -Sy
- pacman -S --noconfirm git gcc make postgresql-libs
## `bash` is required by `nodenv`, as I see
- apk add --no-cache bash git # gcc make postgresql-libs

- echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
- echo 'eval "$(rbenv init -)"' >> ~/.bashrc
- echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.rbenv_init
- echo 'eval "$(rbenv init -)"' >> ~/.rbenv_init

- echo 'export PATH="$HOME/.nodenv/bin:$PATH"' >> ~/.bashrc
- echo 'eval "$(nodenv init -)"' >> ~/.bashrc
- echo 'export PATH="$HOME/.nodenv/bin:$PATH"' >> ~/.nodenv_init
- echo 'eval "$(nodenv init -)"' >> ~/.nodenv_init

rbenv_cache: &rbenv_cache
rbenv_cache:
folder: $HOME/.rbenv
fingerprint_script:
- echo $CIRRUS_OS
- echo $CI_IMAGE
- cat .ruby-version
populate_script:
- git clone https://github.com/rbenv/rbenv.git ~/.rbenv

- source ~/.bashrc
- . ~/.rbenv_init

## https://github.com/rbenv/ruby-build#installation
- mkdir -p "$(rbenv root)"/plugins
Expand All @@ -33,11 +36,12 @@ nodenv_cache: &nodenv_cache
folder: $HOME/.nodenv
fingerprint_script:
- echo $CIRRUS_OS
- echo $CI_IMAGE
- cat .node-version
populate_script:
- git clone https://github.com/nodenv/nodenv.git ~/.nodenv

- source ~/.bashrc
- . ~/.nodenv_init

## https://github.com/nodenv/node-build#installation
- mkdir -p "$(nodenv root)"/plugins
Expand All @@ -50,21 +54,23 @@ bundle_cache: &bundle_cache
folder: /usr/local/bundle
fingerprint_script:
- echo $CIRRUS_OS
- echo $CI_IMAGE
- cat .ruby-version
- cat Gemfile.lock
install_script:
- source ~/.bashrc
- . ~/.rbenv_init
- exe/setup/ruby.sh

node_modules_cache: &node_modules_cache
node_modules_cache:
folder: node_modules
fingerprint_script:
- echo $CIRRUS_OS
- echo $CI_IMAGE
- cat .node-version
- cat pnpm-lock.yaml
install_script:
- source ~/.bashrc
- . ~/.nodenv_init
- exe/setup/node.sh


Expand All @@ -77,7 +83,7 @@ remark_task:
<<: *node_modules_cache

lint_script:
- source ~/.bashrc
- . ~/.nodenv_init
- pnpm run lint:docs

only_if: ($CIRRUS_BRANCH == 'master') ||
Expand All @@ -95,7 +101,7 @@ stylelint_task:
<<: *node_modules_cache

lint_script:
- source ~/.bashrc
- . ~/.nodenv_init
- pnpm run lint:styles

only_if: ($CIRRUS_BRANCH == 'master') ||
Expand All @@ -113,7 +119,7 @@ eslint_task:
<<: *node_modules_cache

lint_script:
- source ~/.bashrc
- . ~/.nodenv_init
- pnpm run lint:scripts

only_if: ($CIRRUS_BRANCH == 'master') ||
Expand All @@ -136,7 +142,7 @@ rubocop_task:
<<: *bundle_cache

lint_script:
- source ~/.bashrc
- . ~/.rbenv_init
- bundle exec rubocop --format=json --out=rubocop.json

only_if: ($CIRRUS_BRANCH == 'master') ||
Expand Down