.github: make use of working-directory

One can specify working directory of a step, no by `cd foo` inside of
the run. See also
https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idstepsrun
This commit is contained in:
卜部昌平 2020-02-26 13:12:46 +09:00
Родитель e06ad731f0
Коммит 888e736524
5 изменённых файлов: 68 добавлений и 67 удалений

32
.github/workflows/macos.yml поставляемый
Просмотреть файл

@ -29,35 +29,31 @@ jobs:
- name: Install libraries
run: |
export WAITS='5 60'
cd src
tool/travis_retry.sh brew upgrade
tool/travis_retry.sh brew install gdbm gmp libffi openssl@1.1 zlib autoconf automake libtool readline
working-directory: src
- name: Set ENV
run: |
echo '::set-env name=JOBS::'-j$((1 + $(sysctl -n hw.activecpu)))
- name: Autoconf
run: |
cd src
autoconf
- name: Configure
run: |
mkdir build
cd build
../src/configure -C --disable-install-doc --with-openssl-dir=$(brew --prefix openssl@1.1) --with-readline-dir=$(brew --prefix readline)
- name: Make
run: make -C build $JOBS
- name: Extract gems
run: make -C build update-gems extract-gems
- run: autoconf
working-directory: src
- run: mkdir build
- 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
working-directory: build
- run: make update-gems extract-gems
working-directory: build
if: matrix.test_task == 'check'
- name: Tests
run: make -C build $JOBS -s ${{ matrix.test_task }}
- run: make $JOBS -s ${{ matrix.test_task }}
working-directory: build
env:
RUBY_TESTOPTS: "-q --tty=no"
# Remove minitest from TEST_BUNDLED_GEMS_ALLOW_FAILURES if https://github.com/seattlerb/minitest/pull/798 is resolved
# rss needs to add workaround for the non rexml environment
TEST_BUNDLED_GEMS_ALLOW_FAILURES: "minitest,xmlrpc,rss,rexml"
- name: Leaked Globals
run: make -C build -s leaked-globals
- run: make -s leaked-globals
working-directory: build
- uses: k0kubun/action-slack@v2.0.0
with:
payload: |

26
.github/workflows/mingw.yml поставляемый
Просмотреть файл

@ -71,12 +71,12 @@ jobs:
sh -c "autoreconf -fi"
- name: configure
working-directory: build
run: |
# Actions uses UTF8, causes test failures, similar to normal OS setup
$PSDefaultParameterValues['*:Encoding'] = 'utf8'
[Console]::OutputEncoding = [System.Text.Encoding]::GetEncoding("IBM437")
[Console]::InputEncoding = [System.Text.Encoding]::GetEncoding("IBM437")
cd build
$config_args = "--build=$env:CHOST --host=$env:CHOST --target=$env:CHOST"
Write-Host $config_args
sh -c "../src/configure --disable-install-doc --prefix=/install $config_args"
@ -84,54 +84,58 @@ jobs:
# Get-Content ./config.log | foreach {Write-Output $_}
- name: download unicode, gems, etc
working-directory: build
run: |
$jobs = [int]$env:NUMBER_OF_PROCESSORS + 1
cd build
make -j $jobs update-unicode
make -j $jobs update-gems
- name: make all
timeout-minutes: 20
working-directory: build
run: |
$jobs = [int]$env:NUMBER_OF_PROCESSORS + 1
make -C build -j $jobs V=1
make -j $jobs V=1
- name: make install
working-directory: build
run: |
# Actions uses UTF8, causes test failures, similar to normal OS setup
$PSDefaultParameterValues['*:Encoding'] = 'utf8'
[Console]::OutputEncoding = [System.Text.Encoding]::GetEncoding("IBM437")
[Console]::InputEncoding = [System.Text.Encoding]::GetEncoding("IBM437")
make -C build DESTDIR=.. install-nodoc
make DESTDIR=.. install-nodoc
- name: test
timeout-minutes: 5
working-directory: build
run: |
$env:TMPDIR = "$pwd/temp"
make -C build test
$env:TMPDIR = "$pwd/../temp"
make test
- name: test-all
timeout-minutes: 25
working-directory: build
run: |
$env:TMPDIR = "$pwd/temp"
$env:TMPDIR = "$pwd/../temp"
# Actions uses UTF8, causes test failures, similar to normal OS setup
$PSDefaultParameterValues['*:Encoding'] = 'utf8'
[Console]::OutputEncoding = [System.Text.Encoding]::GetEncoding("IBM437")
[Console]::InputEncoding = [System.Text.Encoding]::GetEncoding("IBM437")
$jobs = [int]$env:NUMBER_OF_PROCESSORS
make -C build test-all TESTOPTS="-j $jobs --retry --job-status=normal --show-skip --timeout-scale=1.5"
make test-all TESTOPTS="-j $jobs --retry --job-status=normal --show-skip --timeout-scale=1.5"
- name: test-spec
timeout-minutes: 10
working-directory: src/spec/ruby
run: |
$env:TMPDIR = "$pwd/temp"
$env:PATH = "$pwd/install/bin;$env:PATH"
$env:TMPDIR = "$pwd/../temp"
$env:PATH = "$pwd/../install/bin;$env:PATH"
# Actions uses UTF8, causes test failures, similar to normal OS setup
$PSDefaultParameterValues['*:Encoding'] = 'utf8'
[Console]::OutputEncoding = [System.Text.Encoding]::GetEncoding("IBM437")
[Console]::InputEncoding = [System.Text.Encoding]::GetEncoding("IBM437")
ruby -v
cd src/spec/ruby
ruby ../mspec/bin/mspec -j
- uses: k0kubun/action-slack@v2.0.0

38
.github/workflows/mjit.yml поставляемый
Просмотреть файл

@ -9,6 +9,9 @@ jobs:
fail-fast: false
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[ci skip]')"
env:
TESTOPTS: '-q --tty=no'
RUN_OPTS: '--disable-gems --jit-warnings ${{ matrix.jit_opts }}'
steps:
- name: Install libraries
run: |
@ -35,25 +38,24 @@ jobs:
- name: Set ENV
run: |
echo '::set-env name=JOBS::'-j$((1 + $(nproc --all)))
- name: Autoconf
run: cd src && exec autoconf
- run: autoconf
working-directory: src
- run: mkdir build
- name: configure
run: |
mkdir build
cd build
../src/configure -C --disable-install-doc
- name: make all
run: make -C build $JOBS
- name: make install
run: sudo make -C build $JOBS install
- name: make test
run: "make -C build $JOBS -s test TESTOPTS='-q --tty=no' RUN_OPTS='--disable-gems --jit-warnings ${{ matrix.jit_opts }}'"
- name: make test-all
run: "make -C build $JOBS -s test-all TESTOPTS='-q --tty=no' RUN_OPTS='--disable-gems --jit-warnings ${{ matrix.jit_opts }}'"
- name: make test-spec
run: "make -C build $JOBS -s test-spec RUN_OPTS='--disable-gems --jit-warnings ${{ matrix.jit_opts }}'"
- name: Leaked Globals
run: make -C build -s leaked-globals
run: ../src/configure -C --disable-install-doc
working-directory: build
- run: make $JOBS
working-directory: build
- run: sudo make $JOBS -s install
working-directory: build
- run: make $JOBS -s test
working-directory: build
- run: make $JOBS -s test-all
working-directory: build
- run: make $JOBS -s test-spec
working-directory: build
- run: make -s leaked-globals
working-directory: build
- uses: k0kubun/action-slack@v2.0.0
with:
payload: |

30
.github/workflows/ubuntu.yml поставляемый
Просмотреть файл

@ -42,32 +42,30 @@ jobs:
- name: Set ENV
run: |
echo '::set-env name=JOBS::'-j$((1 + $(nproc --all)))
- name: Autoconf
run: cd src && exec autoconf
- name: configure
run: |
mkdir build
cd build
../src/configure -C --disable-install-doc
- name: Make
run: make -C build $JOBS
- name: Extract gems
run: make -C build update-gems extract-gems
- run: autoconf
working-directory: src
- run: mkdir build
- run: ../src/configure -C --disable-install-doc
working-directory: build
- run: make $JOBS
working-directory: build
- run: make update-gems extract-gems
working-directory: build
if: matrix.test_task == 'check'
- name: Create dummy files in build dir
run: |
cd build
./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'
- name: Tests
run: make -C build $JOBS -s ${{ matrix.test_task }}
- run: make $JOBS -s ${{ matrix.test_task }}
working-directory: build
env:
RUBY_TESTOPTS: "-q --tty=no"
# Remove minitest from TEST_BUNDLED_GEMS_ALLOW_FAILURES if https://github.com/seattlerb/minitest/pull/798 is resolved
# rss needs to add workaround for the non rexml environment
TEST_BUNDLED_GEMS_ALLOW_FAILURES: "minitest,xmlrpc,rss"
- name: Leaked Globals
run: make -C build -s leaked-globals
- run: make -s leaked-globals
working-directory: build
- uses: k0kubun/action-slack@v2.0.0
with:
payload: |

9
.github/workflows/windows.yml поставляемый
Просмотреть файл

@ -46,28 +46,29 @@ jobs:
- run: ./src/tool/actions-commit-info.sh
shell: bash
id: commit_info
- run: md build
shell: cmd
- name: Configure
run: |
md build
cd build
call "C:\Program Files (x86)\Microsoft Visual Studio\${{ matrix.vs }}\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
../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 "C:\Program Files (x86)\Microsoft Visual Studio\${{ matrix.vs }}\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
set YACC=win_bison
cd build
echo on
nmake up
nmake extract-gems
nmake
working-directory: build
shell: cmd
- name: nmake test
run: |
call "C:\Program Files (x86)\Microsoft Visual Studio\${{ matrix.vs }}\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
cd build
nmake ${{ matrix.test_task }}
working-directory: build
shell: cmd
- uses: k0kubun/action-slack@v2.0.0
with: