mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
.github: reduce copy&paste
Found that we can set default working directory for github actions.
This commit is contained in:
parent
1c5f44cd72
commit
da25affdac
Notes:
git
2020-10-21 09:25:12 +09:00
7 changed files with 40 additions and 70 deletions
24
.github/workflows/check_dependencies.yml
vendored
24
.github/workflows/check_dependencies.yml
vendored
|
@ -2,11 +2,7 @@ name: Check Dependencies
|
|||
on: [push, pull_request]
|
||||
jobs:
|
||||
update-deps:
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-20.04]
|
||||
fail-fast: true
|
||||
runs-on: ${{ matrix.os }}
|
||||
runs-on: ubuntu-20.04
|
||||
if: "!contains(github.event.head_commit.message, '[ci skip]')"
|
||||
steps:
|
||||
- name: Install libraries
|
||||
|
@ -18,28 +14,12 @@ jobs:
|
|||
run: |
|
||||
git config --global advice.detachedHead 0
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
path: src
|
||||
- name: Fixed world writable dirs
|
||||
run: |
|
||||
chmod -v go-w $HOME $HOME/.config
|
||||
sudo chmod -R go-w /usr/share
|
||||
sudo bash -c 'IFS=:; for d in '"$PATH"'; do chmod -v go-w $d; done' || :
|
||||
- name: Set ENV
|
||||
run: |
|
||||
echo "JOBS=-j$((1 + $(nproc --all)))" >> $GITHUB_ENV
|
||||
- run: autoconf
|
||||
working-directory: src
|
||||
- name: Run configure
|
||||
run: ./configure -C --disable-install-doc --disable-rubygems --with-gcc 'optflags=-O0' 'debugflags=-save-temps=obj -g'
|
||||
working-directory: src
|
||||
- name: Run make
|
||||
run: make all golf
|
||||
working-directory: src
|
||||
- run: make all golf
|
||||
- run: ruby tool/update-deps --fix
|
||||
working-directory: src
|
||||
- run: git diff --no-ext-diff --ignore-submodules --exit-code
|
||||
working-directory: src
|
||||
- uses: k0kubun/action-slack@v2.0.0
|
||||
with:
|
||||
payload: |
|
||||
|
|
17
.github/workflows/compilers.yml
vendored
17
.github/workflows/compilers.yml
vendored
|
@ -159,18 +159,18 @@ jobs:
|
|||
container: ghcr.io/ruby/ruby-ci-image:latest
|
||||
if: "!contains(github.event.head_commit.message, '[ci skip]')"
|
||||
steps:
|
||||
- run: mkdir build
|
||||
working-directory:
|
||||
- name: setenv
|
||||
run: |
|
||||
echo "${{ matrix.entry.key }}=${{ matrix.entry.value }}" >> $GITHUB_ENV
|
||||
echo "make=make -sj$((1 + $(nproc --all)))" >> $GITHUB_ENV
|
||||
- run: mkdir build
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
path: src
|
||||
- run: autoconf
|
||||
working-directory: src
|
||||
- name: Run configure
|
||||
working-directory: build
|
||||
run: |
|
||||
if [ -n "${crosshost}" ]; then
|
||||
../src/configure -C \
|
||||
|
@ -184,27 +184,18 @@ jobs:
|
|||
--with-gcc="${default_cc} ${append_cc}"
|
||||
fi
|
||||
- run: $make extract-extlibs
|
||||
working-directory: build
|
||||
- run: $make incs
|
||||
working-directory: build
|
||||
- run: $make
|
||||
working-directory: build
|
||||
- run: $make test
|
||||
working-directory: build
|
||||
- run: $make install
|
||||
working-directory: build
|
||||
if: "matrix.entry.name == '-O3'"
|
||||
- run: /usr/local/bin/gem install --no-doc timezone tzinfo
|
||||
working-directory: build
|
||||
if: "matrix.entry.name == '-O3'"
|
||||
- run: $make test-tool
|
||||
working-directory: build
|
||||
if: "matrix.entry.name == '-O3'"
|
||||
- run: $make test-all TESTS='-- ruby -ext-'
|
||||
working-directory: build
|
||||
if: "matrix.entry.name == '-O3'"
|
||||
- run: $make test-spec
|
||||
working-directory: build
|
||||
if: "matrix.entry.name == '-O3'"
|
||||
|
||||
- uses: k0kubun/action-slack@v2.0.0
|
||||
|
@ -220,3 +211,7 @@ jobs:
|
|||
env:
|
||||
SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot
|
||||
if: failure() && github.event_name == 'push'
|
||||
|
||||
defaults:
|
||||
run:
|
||||
working-directory: build
|
||||
|
|
12
.github/workflows/macos.yml
vendored
12
.github/workflows/macos.yml
vendored
|
@ -11,6 +11,8 @@ jobs:
|
|||
GITPULLOPTIONS: --no-tags origin ${{github.ref}}
|
||||
if: "!contains(github.event.head_commit.message, '[ci skip]')"
|
||||
steps:
|
||||
- run: mkdir build
|
||||
working-directory:
|
||||
- name: Disable Firewall
|
||||
run: |
|
||||
sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setglobalstate off
|
||||
|
@ -32,20 +34,14 @@ jobs:
|
|||
echo "JOBS=-j$((1 + $(sysctl -n hw.activecpu)))" >> $GITHUB_ENV
|
||||
- run: autoconf
|
||||
working-directory: src
|
||||
- run: mkdir build
|
||||
- name: Run configure
|
||||
run: ../src/configure -C --disable-install-doc --with-openssl-dir=$(brew --prefix openssl@1.1) --with-readline-dir=$(brew --prefix readline)
|
||||
working-directory: build
|
||||
- run: make $JOBS incs
|
||||
working-directory: build
|
||||
- run: make $JOBS
|
||||
working-directory: build
|
||||
- run: make prepare-gems
|
||||
working-directory: build
|
||||
if: matrix.test_task == 'check'
|
||||
- run: make $JOBS -s ${{ matrix.test_task }}
|
||||
timeout-minutes: 60
|
||||
working-directory: build
|
||||
env:
|
||||
RUBY_TESTOPTS: "-q --tty=no"
|
||||
TEST_BUNDLED_GEMS_ALLOW_FAILURES: "rexml"
|
||||
|
@ -62,3 +58,7 @@ jobs:
|
|||
env:
|
||||
SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot
|
||||
if: failure() && github.event_name == 'push'
|
||||
|
||||
defaults:
|
||||
run:
|
||||
working-directory: build
|
||||
|
|
15
.github/workflows/mingw.yml
vendored
15
.github/workflows/mingw.yml
vendored
|
@ -24,6 +24,8 @@ jobs:
|
|||
fail-fast: false
|
||||
if: "!contains(github.event.head_commit.message, '[ci skip]')"
|
||||
steps:
|
||||
- run: mkdir build
|
||||
working-directory:
|
||||
- name: git config
|
||||
run: |
|
||||
git config --system core.autocrlf false
|
||||
|
@ -50,14 +52,13 @@ jobs:
|
|||
}
|
||||
- name: misc setup, autoreconf
|
||||
run: |
|
||||
mkdir build
|
||||
mkdir install
|
||||
mkdir temp
|
||||
cd src
|
||||
sh -c "autoreconf -fi"
|
||||
working-directory:
|
||||
|
||||
- name: configure
|
||||
working-directory: build
|
||||
run: |
|
||||
# Actions uses UTF8, causes test failures, similar to normal OS setup
|
||||
$PSDefaultParameterValues['*:Encoding'] = 'utf8'
|
||||
|
@ -70,26 +71,22 @@ jobs:
|
|||
# Get-Content ./config.log | foreach {Write-Output $_}
|
||||
|
||||
- name: update
|
||||
working-directory: build
|
||||
run: |
|
||||
$jobs = [int](2 * $env:NUMBER_OF_PROCESSORS)
|
||||
make -j $jobs incs
|
||||
|
||||
- name: download gems
|
||||
working-directory: build
|
||||
run: |
|
||||
$jobs = [int](2 * $env:NUMBER_OF_PROCESSORS)
|
||||
make -j $jobs update-gems
|
||||
|
||||
- name: make all
|
||||
timeout-minutes: 40
|
||||
working-directory: build
|
||||
run: |
|
||||
$jobs = [int](2 * $env:NUMBER_OF_PROCESSORS)
|
||||
make -j $jobs
|
||||
|
||||
- name: make install
|
||||
working-directory: build
|
||||
run: |
|
||||
# Actions uses UTF8, causes test failures, similar to normal OS setup
|
||||
$PSDefaultParameterValues['*:Encoding'] = 'utf8'
|
||||
|
@ -99,13 +96,11 @@ jobs:
|
|||
|
||||
- name: test
|
||||
timeout-minutes: 5
|
||||
working-directory: build
|
||||
run: |
|
||||
make test
|
||||
|
||||
- name: test-all
|
||||
timeout-minutes: 60
|
||||
working-directory: build
|
||||
run: |
|
||||
# Actions uses UTF8, causes test failures, similar to normal OS setup
|
||||
$PSDefaultParameterValues['*:Encoding'] = 'utf8'
|
||||
|
@ -139,3 +134,7 @@ jobs:
|
|||
env:
|
||||
SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot
|
||||
if: failure() && github.event_name == 'push'
|
||||
|
||||
defaults:
|
||||
run:
|
||||
working-directory: build
|
||||
|
|
14
.github/workflows/mjit.yml
vendored
14
.github/workflows/mjit.yml
vendored
|
@ -14,6 +14,8 @@ jobs:
|
|||
RUN_OPTS: '--disable-gems ${{ matrix.jit_opts }}'
|
||||
GITPULLOPTIONS: --no-tags origin ${{github.ref}}
|
||||
steps:
|
||||
- run: mkdir build
|
||||
working-directory:
|
||||
- name: Install libraries
|
||||
run: |
|
||||
set -x
|
||||
|
@ -35,25 +37,17 @@ jobs:
|
|||
echo "JOBS=-j$((1 + $(nproc --all)))" >> $GITHUB_ENV
|
||||
- run: autoconf
|
||||
working-directory: src
|
||||
- run: mkdir build
|
||||
- name: Run configure
|
||||
run: ../src/configure -C --disable-install-doc
|
||||
working-directory: build
|
||||
- run: make $JOBS incs
|
||||
working-directory: build
|
||||
- run: make $JOBS
|
||||
working-directory: build
|
||||
- run: sudo make $JOBS -s install
|
||||
working-directory: build
|
||||
- run: make $JOBS -s test RUN_OPTS="$RUN_OPTS"
|
||||
timeout-minutes: 10
|
||||
working-directory: build
|
||||
- run: make $JOBS -s test-all RUN_OPTS="$RUN_OPTS"
|
||||
timeout-minutes: 10
|
||||
working-directory: build
|
||||
- run: make $JOBS -s test-spec RUN_OPTS="$RUN_OPTS"
|
||||
timeout-minutes: 5
|
||||
working-directory: build
|
||||
- uses: k0kubun/action-slack@v2.0.0
|
||||
with:
|
||||
payload: |
|
||||
|
@ -67,3 +61,7 @@ jobs:
|
|||
env:
|
||||
SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot
|
||||
if: failure() && github.event_name == 'push'
|
||||
|
||||
defaults:
|
||||
run:
|
||||
working-directory: build
|
||||
|
|
13
.github/workflows/ubuntu.yml
vendored
13
.github/workflows/ubuntu.yml
vendored
|
@ -29,6 +29,8 @@ jobs:
|
|||
runs-on: ${{ matrix.os }}
|
||||
if: "!contains(github.event.head_commit.message, '[ci skip]')"
|
||||
steps:
|
||||
- run: mkdir build
|
||||
working-directory:
|
||||
- name: Install libraries
|
||||
run: |
|
||||
set -x
|
||||
|
@ -50,25 +52,18 @@ jobs:
|
|||
echo "JOBS=-j$((1 + $(nproc --all)))" >> $GITHUB_ENV
|
||||
- run: autoconf
|
||||
working-directory: src
|
||||
- run: mkdir build
|
||||
- name: Run configure
|
||||
run: ../src/configure -C --disable-install-doc cppflags=${{ matrix.debug }}
|
||||
working-directory: build
|
||||
- run: make $JOBS incs
|
||||
working-directory: build
|
||||
- run: make $JOBS
|
||||
working-directory: build
|
||||
- run: make prepare-gems
|
||||
working-directory: build
|
||||
if: matrix.test_task == 'check'
|
||||
- name: Create dummy files in build dir
|
||||
run: |
|
||||
./miniruby -e '(("a".."z").to_a+("A".."Z").to_a+("0".."9").to_a+%w[foo bar test zzz]).each{|basename|File.write("#{basename}.rb", "raise %(do not load #{basename}.rb)")}'
|
||||
working-directory: build
|
||||
if: matrix.test_task == 'check'
|
||||
- run: make $JOBS -s ${{ matrix.test_task }}
|
||||
timeout-minutes: 30
|
||||
working-directory: build
|
||||
env:
|
||||
RUBY_TESTOPTS: "-q --tty=no"
|
||||
TEST_BUNDLED_GEMS_ALLOW_FAILURES: ""
|
||||
|
@ -85,3 +80,7 @@ jobs:
|
|||
env:
|
||||
SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot
|
||||
if: failure() && github.event_name == 'push'
|
||||
|
||||
defaults:
|
||||
run:
|
||||
working-directory: build
|
||||
|
|
15
.github/workflows/windows.yml
vendored
15
.github/workflows/windows.yml
vendored
|
@ -14,6 +14,8 @@ jobs:
|
|||
VCVARS: C:\Program Files (x86)\Microsoft Visual Studio\${{ matrix.vs }}\Enterprise\VC\Auxiliary\Build\vcvars64.bat
|
||||
if: "!contains(github.event.head_commit.message, '[ci skip]')"
|
||||
steps:
|
||||
- run: md build
|
||||
working-directory:
|
||||
- uses: actions/cache@v2
|
||||
with:
|
||||
path: C:\vcpkg\downloads
|
||||
|
@ -41,14 +43,10 @@ jobs:
|
|||
- uses: actions/checkout@v2
|
||||
with:
|
||||
path: src
|
||||
- run: md build
|
||||
shell: cmd
|
||||
- name: Configure
|
||||
run: |
|
||||
call "%VCVARS%"
|
||||
../src/win32/configure.bat --disable-install-doc --without-ext=+,dbm,gdbm --enable-bundled-libffi --with-opt-dir=C:/vcpkg/installed/x64-windows --with-openssl-dir="C:/Program Files/OpenSSL-Win64"
|
||||
working-directory: build
|
||||
shell: cmd
|
||||
- name: nmake
|
||||
run: |
|
||||
call "%VCVARS%"
|
||||
|
@ -57,15 +55,11 @@ jobs:
|
|||
nmake incs
|
||||
nmake extract-extlibs
|
||||
nmake
|
||||
working-directory: build
|
||||
shell: cmd
|
||||
- name: nmake test
|
||||
timeout-minutes: 30
|
||||
run: |
|
||||
call "%VCVARS%"
|
||||
nmake ${{ matrix.test_task }}
|
||||
working-directory: build
|
||||
shell: cmd
|
||||
- uses: k0kubun/action-slack@v2.0.0
|
||||
with:
|
||||
payload: |
|
||||
|
@ -79,3 +73,8 @@ jobs:
|
|||
env:
|
||||
SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot
|
||||
if: failure() && github.event_name == 'push'
|
||||
|
||||
defaults:
|
||||
run:
|
||||
working-directory: build
|
||||
shell: cmd
|
||||
|
|
Loading…
Add table
Reference in a new issue