Skip to content

Commit

Permalink
Merge pull request #587 from falgon/develop
Browse files Browse the repository at this point in the history
master <- develop
  • Loading branch information
kodiakhq[bot] authored Sep 14, 2024
2 parents 0dd2e94 + d67cc47 commit 8434f66
Show file tree
Hide file tree
Showing 15 changed files with 1,775 additions and 178 deletions.
23 changes: 23 additions & 0 deletions .github/pr-labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
style:
- changed-files:
- any-glob-to-any-file: 'contents/scss/**'

CI:
- all:
- changed-files:
- any-glob-to-any-file: '.github/**'
- all-globs-to-all-files: '!.github/ISSUE_TEMPLATE/**'

documentation:
- changed-files:
- any-glob-to-any-file:
- '**/*.md'
- '**/*.markdown'

docker:
- changed-files:
- any-glob-to-any-file: 'docker/**'

pages:
- changed-files:
- any-glob-to-any-file: 'contents/pages/**'
19 changes: 17 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,24 @@ jobs:
with:
path: ~/.stack
key: stack-v2-${{ runner.os }}-${{ hashFiles('stack.yaml') }}-${{ hashFiles('stack.yaml.lock') }}-${{ hashFiles('package.yaml') }}-${{ hashFiles('docker/.env') }}
- name: Install tools
- name: Install tools (apt)
uses: awalsh128/cache-apt-pkgs-action@v1.4.2
with:
packages: libxml2-utils
version: 1.0
- name: snap cache
uses: actions/cache@v2
env:
cache-name: cache-snap-packages
with:
path: ~/snap
key: ${{ runner.os }}-snap-${{ env.cache-name }}-${{ hashFiles('**/snap-packages.txt') }}
restore-keys: |
${{ runner.os }}-snap-${{ env.cache-name }}-
${{ runner.os }}-snap-
${{ runner.os }}-
- name: Install tools (snap)
run: sudo snap install chromium
- name: Setup Stack
if: steps.site-gen-cache.outputs.cache-hit != 'true' && steps.stack-cache.outputs.cache-hit != 'true'
run: |
Expand All @@ -64,7 +77,9 @@ jobs:
with:
node-version-file: '.nvmrc'
- name: Export values
run: echo "ROKI_WEB_GH_ACTIONS_NODE_VERSION=$(node --version)" >> "$GITHUB_ENV"
run: |
echo "ROKI_WEB_GH_ACTIONS_NODE_VERSION=$(node --version)" >> "$GITHUB_ENV"
echo "PUPPETEER_EXECUTABLE_PATH=$(which chromium)" >> "$GITHUB_ENV"
- name: Node module cache
uses: actions/cache@v4
id: node-cache
Expand Down
19 changes: 17 additions & 2 deletions .github/workflows/build_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,24 @@ jobs:
ghc-version: ${{ env.ghc_version }}
enable-stack: true
stack-version: ${{ env.stack_version }}
- name: Install tools
- name: Install tools (apt)
uses: awalsh128/cache-apt-pkgs-action@v1.4.2
with:
packages: libxml2-utils parallel
version: 1.0
- name: snap cache
uses: actions/cache@v2
env:
cache-name: cache-snap-packages
with:
path: ~/snap
key: ${{ runner.os }}-snap-${{ env.cache-name }}-${{ hashFiles('**/snap-packages.txt') }}
restore-keys: |
${{ runner.os }}-snap-${{ env.cache-name }}-
${{ runner.os }}-snap-
${{ runner.os }}-
- name: Install tools (snap)
run: sudo snap install chromium
- name: Setup Stack
if: steps.site-gen-cache.outputs.cache-hit != 'true' && steps.stack-cache.outputs.cache-hit != 'true'
run: |
Expand All @@ -68,7 +81,9 @@ jobs:
with:
node-version-file: '.nvmrc'
- name: Export values
run: echo "ROKI_WEB_GH_ACTIONS_NODE_VERSION=$(node --version)" >> "$GITHUB_ENV"
run: |
echo "ROKI_WEB_GH_ACTIONS_NODE_VERSION=$(node --version)" >> "$GITHUB_ENV"
echo "PUPPETEER_EXECUTABLE_PATH=$(which chromium)" >> "$GITHUB_ENV"
- name: Node module cache
uses: actions/cache@v4
id: node-cache
Expand Down
20 changes: 20 additions & 0 deletions .github/workflows/pr-labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: CI-pr-label
on:
pull_request_target:
types:
- opened
jobs:
label:
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Labeling
uses: actions/labeler@v5
with:
configuration-path: .github/pr-labeler.yml
sync-labels: true
36 changes: 36 additions & 0 deletions .github/workflows/restyled.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: CI-Restyled

on:
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
restyled:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}

- uses: restyled-io/actions/setup@v4
- id: restyler
uses: restyled-io/actions/run@v4
with:
fail-on-differences: true

- if: |
!cancelled() &&
steps.restyler.outputs.success == 'true' &&
github.event.pull_request.head.repo.full_name == github.repository
uses: peter-evans/create-pull-request@v6
with:
base: ${{ steps.restyler.outputs.restyled-base }}
branch: ${{ steps.restyler.outputs.restyled-head }}
title: ${{ steps.restyler.outputs.restyled-title }}
body: ${{ steps.restyler.outputs.restyled-body }}
labels: "restyled"
reviewers: ${{ github.event.pull_request.user.login }}
delete-branch: true
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

| CI | Deployment | Inspection | Quality | PR check | Docs |
| :--: | :--: | :--: | :--: | :--: | :--: |
| [![CI-push](https://github.com/falgon/roki-web/actions/workflows/build.yml/badge.svg)](https://github.com/falgon/roki-web/actions/workflows/build.yml) | [![pages-build-deployment](https://github.com/falgon/roki-web/actions/workflows/pages/pages-build-deployment/badge.svg)](https://github.com/falgon/roki-web/actions/workflows/pages/pages-build-deployment) [![CircleCI](https://dl.circleci.com/status-badge/img/gh/falgon/roki-web/tree/develop.svg?style=shield)](https://dl.circleci.com/status-badge/redirect/gh/falgon/roki-web/tree/develop) | [![Known Vulnerabilities](https://snyk.io/test/github/falgon/roki-web/badge.svg?targetFile=package.json)](https://snyk.io/test/github/falgon/roki-web?targetFile=package.json) [![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgit.luolix.top%2Ffalgon%2Froki-web.svg?type=shield)](https://app.fossa.com/projects/git%2Bgit.luolix.top%2Ffalgon%2Froki-web?ref=badge_shield) | [![CodeFactor](https://www.codefactor.io/repository/github/falgon/roki-web/badge?s=e4b1f45b3bb2dc89c42f654d991238ef7771bc9f)](https://www.codefactor.io/repository/github/falgon/roki-web) [![Codacy Badge](https://app.codacy.com/project/badge/Grade/0f3e0d5c5bbe43a78eaeed7485b72c7f)](https://www.codacy.com?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=falgon/roki-web&amp;utm_campaign=Badge_Grade) [![Maintainability](https://api.codeclimate.com/v1/badges/e6574c3042df63bf6d41/maintainability)](https://codeclimate.com/github/falgon/roki-web/maintainability) | [![CircleCI](https://dl.circleci.com/status-badge/img/gh/falgon/roki-web/tree/develop.svg?style=svg)](https://dl.circleci.com/status-badge/redirect/gh/falgon/roki-web/tree/develop)[![CI-pr](https://github.com/falgon/roki-web/actions/workflows/build_pr.yml/badge.svg?branch=develop)](https://github.com/falgon/roki-web/actions/workflows/build_pr.yml) | [![manually-haddock](https://github.com/falgon/roki-web/actions/workflows/haddock.yml/badge.svg?branch=master)](https://github.com/falgon/roki-web/actions/workflows/haddock.yml) |
| [![CI-push](https://github.com/falgon/roki-web/actions/workflows/build.yml/badge.svg)](https://github.com/falgon/roki-web/actions/workflows/build.yml) | [![pages-build-deployment](https://github.com/falgon/roki-web/actions/workflows/pages/pages-build-deployment/badge.svg)](https://github.com/falgon/roki-web/actions/workflows/pages/pages-build-deployment) [![CircleCI](https://dl.circleci.com/status-badge/img/gh/falgon/roki-web/tree/develop.svg?style=shield)](https://dl.circleci.com/status-badge/redirect/gh/falgon/roki-web/tree/develop) | [![Known Vulnerabilities](https://snyk.io/test/github/falgon/roki-web/badge.svg?targetFile=package.json)](https://snyk.io/test/github/falgon/roki-web?targetFile=package.json) [![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgit.luolix.top%2Ffalgon%2Froki-web.svg?type=shield)](https://app.fossa.com/projects/git%2Bgit.luolix.top%2Ffalgon%2Froki-web?ref=badge_shield) | [![CodeFactor](https://www.codefactor.io/repository/github/falgon/roki-web/badge?s=e4b1f45b3bb2dc89c42f654d991238ef7771bc9f)](https://www.codefactor.io/repository/github/falgon/roki-web) [![Codacy Badge](https://app.codacy.com/project/badge/Grade/0f3e0d5c5bbe43a78eaeed7485b72c7f)](https://www.codacy.com?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=falgon/roki-web&amp;utm_campaign=Badge_Grade) [![Maintainability](https://api.codeclimate.com/v1/badges/e6574c3042df63bf6d41/maintainability)](https://codeclimate.com/github/falgon/roki-web/maintainability) [![CI-Restyled](https://github.com/falgon/roki-web/actions/workflows/restyled.yml/badge.svg)](https://github.com/falgon/roki-web/actions/workflows/restyled.yml) | [![CircleCI](https://dl.circleci.com/status-badge/img/gh/falgon/roki-web/tree/develop.svg?style=svg)](https://dl.circleci.com/status-badge/redirect/gh/falgon/roki-web/tree/develop)[![CI-pr](https://github.com/falgon/roki-web/actions/workflows/build_pr.yml/badge.svg?branch=develop)](https://github.com/falgon/roki-web/actions/workflows/build_pr.yml) | [![manually-haddock](https://github.com/falgon/roki-web/actions/workflows/haddock.yml/badge.svg?branch=master)](https://github.com/falgon/roki-web/actions/workflows/haddock.yml) |

* **Website**: [roki.dev](https://roki.dev)
* Tech blog: [roki.dev/roki.log](https://roki.dev/roki.log/)
Expand Down
2 changes: 2 additions & 0 deletions docker/contents/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ RUN sed -i 's@archive.ubuntu.com@ftp.jaist.ac.jp/pub/Linux@g' /etc/apt/sources.l
&& apt-get -y -o=Dpkg::Use-Pty=0 -qq install --no-install-recommends \
curl \
ca-certificates \
chromium \
language-pack-ja \
build-essential \
libffi-dev \
Expand All @@ -34,6 +35,7 @@ ENV LANG=ja_JP.UTF-8 \
COPY . /opt/src
WORKDIR /opt/src
RUN export BOOTSTRAP_HASKELL_GHC_VERSION="$(yq '.compiler' ./stack.yaml | cut -f2 -d-)" \
export PUPPETEER_EXECUTABLE_PATH="$(which chromium)" \
&& curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh
RUN source "$HOME/.ghcup/env" \
&& stack config set install-ghc false --global \
Expand Down
2 changes: 2 additions & 0 deletions docker/dev/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ RUN sed -i 's@archive.ubuntu.com@ftp.jaist.ac.jp/pub/Linux@g' /etc/apt/sources.l
build-essential \
curl \
ca-certificates \
chromium \
language-pack-ja \
libtinfo-dev \
git \
Expand Down Expand Up @@ -39,6 +40,7 @@ ENV LANG=ja_JP.UTF-8 \
BOOTSTRAP_HASKELL_NONINTERACTIVE=1
COPY --chown=rw-dev:rw-dev . /home/rw-dev/src
WORKDIR /home/rw-dev/src
ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium
RUN curl -sSo- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.0/install.sh | bash \
&& export NVM_DIR="${HOME}/.nvm" \
&& [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" || true \
Expand Down
Loading

0 comments on commit 8434f66

Please sign in to comment.