[前][次][番号順一覧][スレッド一覧]

ruby-changes:60260

From: =E5=8D=9C=E9=83=A8=E6=98=8C=E5=B9=B3 <ko1@a...>
Date: Mon, 2 Mar 2020 14:53:32 +0900 (JST)
Subject: [ruby-changes:60260] 888e736524 (master): .github: make use of working-directory

https://git.ruby-lang.org/ruby.git/commit/?id=888e736524

From 888e736524ad66369a7cbc065af4a1b5ed591c6a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=8D=9C=E9=83=A8=E6=98=8C=E5=B9=B3?=
 <shyouhei@r...>
Date: Wed, 26 Feb 2020 13:12:46 +0900
Subject: .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

diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml
index dcfc0bd..9c36622 100644
--- a/.github/workflows/macos.yml
+++ b/.github/workflows/macos.yml
@@ -29,35 +29,31 @@ jobs: https://github.com/ruby/ruby/blob/trunk/.github/workflows/macos.yml#L29
       - 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... 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...) --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...) --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@v...
         with:
           payload: |
diff --git a/.github/workflows/mingw.yml b/.github/workflows/mingw.yml
index 508e018..3bdb2f6 100644
--- a/.github/workflows/mingw.yml
+++ b/.github/workflows/mingw.yml
@@ -71,12 +71,12 @@ jobs: https://github.com/ruby/ruby/blob/trunk/.github/workflows/mingw.yml#L71
           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: https://github.com/ruby/ruby/blob/trunk/.github/workflows/mingw.yml#L84
           # 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@v...
diff --git a/.github/workflows/mjit.yml b/.github/workflows/mjit.yml
index b3d7fd1..a71518d 100644
--- a/.github/workflows/mjit.yml
+++ b/.github/workflows/mjit.yml
@@ -9,6 +9,9 @@ jobs: https://github.com/ruby/ruby/blob/trunk/.github/workflows/mjit.yml#L9
       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: https://github.com/ruby/ruby/blob/trunk/.github/workflows/mjit.yml#L38
       - 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@v...
         with:
           payload: |
diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml
index 0246689..f448f20 100644
--- a/.github/workflows/ubuntu.yml
+++ b/.github/workflows/ubuntu.yml
@@ -42,32 +42,30 @@ jobs: https://github.com/ruby/ruby/blob/trunk/.github/workflows/ubuntu.yml#L42
       - 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]).e (... truncated)

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]