Skip to content

Commit

Permalink
add shell lint workflow (#102)
Browse files Browse the repository at this point in the history
* add shell lint workflow

* refactor

* Disable confirmation prompt when installing rust

* rename method name

* add test job

* change job name

* change step name
  • Loading branch information
kuwata0037 authored Aug 15, 2023
1 parent 4cf5d57 commit 21059e8
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 9 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: CI

on: push

jobs:
provisioning:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Apply dotfiles
run: sh -c "$(curl -fsLS chezmoi.io/get)" -- apply --source .

lint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: ludeeus/action-shellcheck@2.0.0
with:
ignore_paths: private_zsh
18 changes: 9 additions & 9 deletions run_once_install_packages.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/usr/bin/env bash

install_apt() {
if type apt >/dev/null 2>&1; then
sudo apt update
sudo apt install -y \
install_system_package() {
if type apt-get >/dev/null 2>&1; then
sudo apt-get update
sudo apt-get install -y \
language-pack-ja \
libgit2-dev \
libssh-dev \
Expand All @@ -15,7 +15,7 @@ install_apt() {
}

install_homebrew() {
if !(type brew >/dev/null 2>&1); then
if ! (type brew >/dev/null 2>&1); then
# Install requirements
# see: https://docs.brew.sh/Homebrew-on-Linux#requirements
if [ "$(uname)" == 'Darwin' ]; then
Expand Down Expand Up @@ -43,8 +43,8 @@ install_homebrew() {
}

install_rust() {
if !(type rustc >/dev/null 2>&1); then
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
if ! (type rustc >/dev/null 2>&1); then
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --no-modify-path
else
echo "You have already installed Rust."
fi
Expand All @@ -62,7 +62,7 @@ install_cargo_subcommand() {
}

install_google_cloud_sdk() {
if !(type gcloud >/dev/null 2>&1); then
if ! (type gcloud >/dev/null 2>&1); then
mkdir -p ~/.google-cloud-sdk
curl -fSL https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-381.0.0-linux-x86_64.tar.gz | tar zx -C ~/.google-cloud-sdk/ --strip-components 1
else
Expand All @@ -71,7 +71,7 @@ install_google_cloud_sdk() {
}

main() {
install_apt
install_system_package
install_homebrew
install_rust
install_cargo_subcommand
Expand Down

0 comments on commit 21059e8

Please sign in to comment.