From 1a0b3bf09bfa66f94fcc49c8f4f90ad9cff2fd21 Mon Sep 17 00:00:00 2001 From: Nathan Moinvaziri Date: Sun, 19 Jun 2022 13:19:53 -0700 Subject: [PATCH] Use working-directory property for run actions instead of changing directory. --- .github/workflows/cmake.yml | 9 +++------ .github/workflows/configure.yml | 10 ++++------ .github/workflows/libpng.yml | 15 ++++++--------- .github/workflows/pigz.yml | 15 ++++++--------- .github/workflows/release.yml | 5 ++--- 5 files changed, 21 insertions(+), 33 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index dcdfee24..b10a5911 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -468,16 +468,13 @@ jobs: CI: true - name: Compile source code - run: | - cd ${{ matrix.build-dir || '.' }} - cmake --build . --config ${{ matrix.build-config || 'Release' }} + run: cmake --build ${{ matrix.build-dir || '.' }} --config ${{ matrix.build-config || 'Release' }} - name: Run test cases # Don't run tests on Windows ARM if: runner.os != 'Windows' || contains(matrix.name, 'ARM') == false - run: | - cd ${{ matrix.build-dir || '.' }} - ctest --verbose -C Release --output-on-failure --max-width 120 -j ${{ matrix.parallels-jobs || '6' }} + run: ctest --verbose -C Release --output-on-failure --max-width 120 -j ${{ matrix.parallels-jobs || '6' }} + working-directory: ${{ matrix.build-dir || '.' }} env: ASAN_OPTIONS: ${{ matrix.asan-options || 'verbosity=0' }}:abort_on_error=1:halt_on_error=1 MSAN_OPTIONS: ${{ matrix.msan-options || 'verbosity=0' }}:abort_on_error=1:halt_on_error=1 diff --git a/.github/workflows/configure.yml b/.github/workflows/configure.yml index 420172ef..2071618f 100644 --- a/.github/workflows/configure.yml +++ b/.github/workflows/configure.yml @@ -214,14 +214,12 @@ jobs: CI: true - name: Compile source code - run: | - cd ${{ matrix.build-dir || '.' }} - make -j2 + run: make -j2 + working-directory: ${{ matrix.build-dir }} - name: Run test cases - run: | - cd ${{ matrix.build-dir || '.' }} - make test + run: make test + working-directory: ${{ matrix.build-dir }} env: QEMU_RUN: ${{ matrix.qemu-run }} ASAN_OPTIONS: abort_on_error=1:halt_on_error=1 diff --git a/.github/workflows/libpng.yml b/.github/workflows/libpng.yml index f25f1686..13326b39 100644 --- a/.github/workflows/libpng.yml +++ b/.github/workflows/libpng.yml @@ -26,19 +26,16 @@ jobs: path: libpng - name: Generate project files (libpng) - run: | - cd libpng - cmake . -DCMAKE_BUILD_TYPE=Release -DPNG_TESTS=ON -DPNG_STATIC=OFF -DZLIB_INCLUDE_DIR=.. -DZLIB_LIBRARY=$PWD/../libz.a + run: cmake . -DCMAKE_BUILD_TYPE=Release -DPNG_TESTS=ON -DPNG_STATIC=OFF -DZLIB_INCLUDE_DIR=.. -DZLIB_LIBRARY=$PWD/../libz.a + working-directory: libpng env: CC: clang CI: true - name: Compile source code (libpng) - run: | - cd libpng - cmake --build . --config Release + run: cmake --build . --config Release + working-directory: libpng - name: Run test cases (libpng) - run: | - cd libpng - ctest -C Release --output-on-failure --max-width 120 + run: ctest -C Release --output-on-failure --max-width 120 + working-directory: libpng diff --git a/.github/workflows/pigz.yml b/.github/workflows/pigz.yml index 82dc7c67..afec6e3e 100644 --- a/.github/workflows/pigz.yml +++ b/.github/workflows/pigz.yml @@ -66,9 +66,8 @@ jobs: sudo apt-get install -y ${{ matrix.packages }} - name: Generate project files - run: | - cd test/pigz - cmake ${{ matrix.cmake-args }} -DCMAKE_BUILD_TYPE=${{ matrix.build-config || 'Release' }} -DBUILD_SHARED_LIBS=OFF -DZLIB_ROOT=../.. -DWITH_CODE_COVERAGE=ON -DWITH_MAINTAINER_WARNINGS=ON + run: cmake ${{ matrix.cmake-args }} -DCMAKE_BUILD_TYPE=${{ matrix.build-config || 'Release' }} -DBUILD_SHARED_LIBS=OFF -DZLIB_ROOT=../.. -DWITH_CODE_COVERAGE=ON -DWITH_MAINTAINER_WARNINGS=ON + working-directory: test/pigz env: CC: ${{ matrix.compiler }} CFLAGS: ${{ matrix.cflags }} @@ -76,14 +75,12 @@ jobs: CI: true - name: Compile source code - run: | - cd test/pigz - cmake --build . --config ${{ matrix.build-config || 'Release' }} + run: cmake --build . --config ${{ matrix.build-config || 'Release' }} + working-directory: test/pigz - name: Run test cases - run: | - cd test/pigz - ctest --verbose -C Release --output-on-failure --max-width 120 -j ${{ matrix.parallels-jobs || '2' }} + run: ctest --verbose -C Release --output-on-failure --max-width 120 -j ${{ matrix.parallels-jobs || '2' }} + working-directory: test/pigz - name: Generate coverage report if: matrix.codecov diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 63649fda..163caa08 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -79,9 +79,8 @@ jobs: - name: Package release (Windows) if: runner.os == 'Windows' - run: | - cd out - 7z a -tzip ../zlib-ng-${{ matrix.deploy-name }}.zip bin include lib ../LICENSE.md ../PORTING.md ../README.md + run: 7z a -tzip ../zlib-ng-${{ matrix.deploy-name }}.zip bin include lib ../LICENSE.md ../PORTING.md ../README.md + working-directory: out - name: Upload release (Windows) uses: svenstaro/upload-release-action@v1-release -- 2.47.3