Skip to content

Commit

Permalink
Add GitHub Actions workflow for building the project
Browse files Browse the repository at this point in the history
  • Loading branch information
hidakatsuya committed May 12, 2024
1 parent 708ccf9 commit e03be00
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 20 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Build

on:
push:
paths-ignore:
- '*.md'

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- uses: ./

- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.3'
bundler-cache: true

- run: |
bin/rails db:prepare
bin/rails test test/unit/news_test.rb
bin/rails test test/system/my_page_test.rb
45 changes: 25 additions & 20 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
name: Setup Redmine
description: Setup Redmine or its distribution for testing
author: hidakatsuya

inputs:
repository:
Expand All @@ -15,38 +16,41 @@ inputs:
required: true
default: 'sqlite3'

runs:
using: composite
env:
CAPYBARA_SERVER_HOST: chrome
CAPYBARA_SERVER_PORT: 4444

pre-if: ${{ runner.os == 'Linux' }}
services:
chrome:
image: selenium/standalone-chrome
ports:
- 4444:4444
postgres:
image: postgres:14
env:
POSTGRES_PASSWORD: postgres
ports:
- 5432:5432

services:
chrome:
image: selenium/standalone-chrome
ports:
- 4444:4444
postgres:
image: postgres:14
env:
POSTGRES_PASSWORD: postgres
ports:
- 5432:5432
runs:
using: composite

steps:
- run: |
apt-get update; \
apt-get install -y --no-install-recommends \
sudo apt-get update; \
sudo apt-get install -y --no-install-recommends \
sudo build-essential curl wget vim \
bzr git mercurial subversion cvs \
ghostscript \
gsfonts \
imagemagick libmagick++-dev \
libsqlite3-dev \
libpgsql-dev \
libpq-dev \
libnss3-dev \
; \
rm -rf /var/lib/apt/lists/*; \
sed -ri 's/(rights)="none" (pattern="PDF")/\1="read" \2/' /etc/ImageMagick-6/policy.xml;
sudo rm -rf /var/lib/apt/lists/*; \
sudo sed -ri 's/(rights)="none" (pattern="PDF")/\1="read" \2/' /etc/ImageMagick-6/policy.xml;
shell: bash
- uses: actions/cache/restore@v4
id: cache-source-restore
Expand All @@ -57,7 +61,7 @@ runs:
- uses: actions/checkout@v4
if: steps.cache-source-restore.outputs.cache-hit != 'true'
with:
repository: ${{ inputs.repository }}-${{ github.sha }}
repository: ${{ inputs.repository }}
ref: ${{ inputs.version }}

- uses: actions/cache/save@v4
Expand Down Expand Up @@ -91,3 +95,4 @@ runs:
exit 1
;;
esac
shell: bash

0 comments on commit e03be00

Please sign in to comment.