diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..ccd2edf --- /dev/null +++ b/.github/workflows/build.yml @@ -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 diff --git a/action.yml b/action.yml index 6b0bfe0..6d5fe1f 100644 --- a/action.yml +++ b/action.yml @@ -1,5 +1,6 @@ name: Setup Redmine description: Setup Redmine or its distribution for testing +author: hidakatsuya inputs: repository: @@ -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/*; \ + sudo rm -rf /var/lib/apt/lists/*; \ 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 @@ -91,3 +95,4 @@ runs: exit 1 ;; esac + shell: bash