ruby-changes:63397
From: =E5=8D=9C=E9=83=A8=E6=98=8C=E5=B9=B3 <ko1@a...>
Date: Wed, 21 Oct 2020 09:25:07 +0900 (JST)
Subject: [ruby-changes:63397] da25affdac (master): .github: reduce copy&paste
https://git.ruby-lang.org/ruby.git/commit/?id=da25affdac From da25affdacc45dd54a1d4c12a5f8394145811276 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: Mon, 19 Oct 2020 15:32:39 +0900 Subject: .github: reduce copy&paste Found that we can set default working directory for github actions. diff --git a/.github/workflows/check_dependencies.yml b/.github/workflows/check_dependencies.yml index 3439c04..0ad2d5e 100644 --- a/.github/workflows/check_dependencies.yml +++ b/.github/workflows/check_dependencies.yml @@ -2,11 +2,7 @@ name: Check Dependencies https://github.com/ruby/ruby/blob/trunk/.github/workflows/check_dependencies.yml#L2 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: https://github.com/ruby/ruby/blob/trunk/.github/workflows/check_dependencies.yml#L14 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@v... with: payload: | diff --git a/.github/workflows/compilers.yml b/.github/workflows/compilers.yml index 88b6c3a..17211b5 100644 --- a/.github/workflows/compilers.yml +++ b/.github/workflows/compilers.yml @@ -159,18 +159,18 @@ jobs: https://github.com/ruby/ruby/blob/trunk/.github/workflows/compilers.yml#L159 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: https://github.com/ruby/ruby/blob/trunk/.github/workflows/compilers.yml#L184 --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@v... @@ -220,3 +211,7 @@ jobs: https://github.com/ruby/ruby/blob/trunk/.github/workflows/compilers.yml#L211 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 diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 34757ea..f035525 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -11,6 +11,8 @@ jobs: https://github.com/ruby/ruby/blob/trunk/.github/workflows/macos.yml#L11 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: https://github.com/ruby/ruby/blob/trunk/.github/workflows/macos.yml#L34 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...) --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: https://github.com/ruby/ruby/blob/trunk/.github/workflows/macos.yml#L58 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 diff --git a/.github/workflows/mingw.yml b/.github/workflows/mingw.yml index 8aacb72..36c8d74 100644 --- a/.github/workflows/mingw.yml +++ b/.github/workflows/mingw.yml @@ -24,6 +24,8 @@ jobs: https://github.com/ruby/ruby/blob/trunk/.github/workflows/mingw.yml#L24 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: https://github.com/ruby/ruby/blob/trunk/.github/workflows/mingw.yml#L52 } - 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: https://github.com/ruby/ruby/blob/trunk/.github/workflows/mingw.yml#L71 # 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: https://github.com/ruby/ruby/blob/trunk/.github/workflows/mingw.yml#L96 - 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: https://github.com/ruby/ruby/blob/trunk/.github/workflows/mingw.yml#L134 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 diff --git a/.github/workflows/mjit.yml b/.github/workflows/mjit.yml index 80ab351..cdb6c94 100644 --- a/.github/workflows/mjit.yml +++ b/.github/workflows/mjit.yml @@ -14,6 +14,8 @@ jobs: https://github.com/ruby/ruby/blob/trunk/.github/workflows/mjit.yml#L14 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: https://github.com/ruby/ruby/blob/trunk/.github/workflows/mjit.yml#L37 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 (... truncated) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/