Skip to content

Merge pull request #103 from sue445/dependabot/bundler/net-ssh-7.2.3 #360

Merge pull request #103 from sue445/dependabot/bundler/net-ssh-7.2.3

Merge pull request #103 from sue445/dependabot/bundler/net-ssh-7.2.3 #360

Workflow file for this run

name: test
on:
push:
branches:
- main
paths-ignore:
- "**.md"
- ".github/dependabot.yml"
workflow_dispatch:
pull_request:
types:
- opened
- synchronize
- reopened
paths-ignore:
- "**.md"
- ".github/dependabot.yml"
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
dockerfile:
- ubuntu-focal-mysql
- ubuntu-focal-mariadb
- ubuntu-jammy-mysql
- ubuntu-jammy-mariadb
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Enable docker layer caching
uses: actions/cache@v4
id: cache
with:
path: /tmp/image.tar
key: v1-${{ runner.os }}-docker-${{ matrix.dockerfile }}-${{ github.sha }}
restore-keys:
v1-${{ runner.os }}-docker-${{ matrix.dockerfile }}
- name: Load Docker image layer cache
run: docker load -i /tmp/image.tar | true
- run: docker build --cache-from=isucon-itamae:latest --file dockerfiles/${DOCKERFILE}.dockerfile --tag isucon-itamae:latest .
env:
DOCKERFILE: ${{ matrix.dockerfile }}
- name: Save Docker image layer cache
run: docker save isucon-itamae:latest -o /tmp/image.tar
- run: docker run --privileged -d --name isucon-itamae_app_1 isucon-itamae:latest /sbin/init
- run: bundle exec rake test:itamae
env:
LOG_LEVEL: info
- run: bundle exec rake test:clean
if: always()
- name: Slack Notification (not success)
uses: lazy-actions/slatify@master
if: "! success()"
continue-on-error: true
with:
job_name: ${{ format('*test* ({0})', matrix.dockerfile) }}
type: ${{ job.status }}
icon_emoji: ":octocat:"
url: ${{ secrets.SLACK_WEBHOOK }}
token: ${{ secrets.GITHUB_TOKEN }}
build_ruby:
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
runner:
# - ubuntu-20.04
- ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- run: .github/workflows/build_ruby.sh
env:
XBUILD_RUBY_VERSION: ruby-dev
- name: Print build log when build is failed
run: cat /tmp/*.log
if: "! success()"
continue-on-error: true
- name: Slack Notification (not success)
uses: lazy-actions/slatify@master
if: "! success()"
continue-on-error: true
with:
job_name: ${{ format('*ruby_build* ({0})', matrix.runner) }}
type: ${{ job.status }}
icon_emoji: ":octocat:"
url: ${{ secrets.SLACK_WEBHOOK }}
token: ${{ secrets.GITHUB_TOKEN }}
notify:
needs:
- test
- build_ruby
runs-on: ubuntu-latest
steps:
- name: Slack Notification (success)
uses: lazy-actions/slatify@master
if: always()
continue-on-error: true
with:
job_name: '*build*'
type: ${{ job.status }}
icon_emoji: ":octocat:"
url: ${{ secrets.SLACK_WEBHOOK }}
token: ${{ secrets.GITHUB_TOKEN }}