From b8c94ee3726152a2112e659426d88df7914f7d3c Mon Sep 17 00:00:00 2001 From: Frantisek Sumsal Date: Wed, 10 Nov 2021 17:15:00 +0100 Subject: [PATCH 1/3] Revert "CI: run GCC unit test job on push to main" This reverts commit c1036042f5aa3369d771776fb6d57fac2543d80d. Follow-up to 0ad536c16a940b4557322f3f811db73c4b374898. --- .github/workflows/unit_tests.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index 0b8c1782ea..d6c3fafabd 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -4,10 +4,6 @@ # name: Unit tests on: - # On push/merge to main we only run the GCC job, to get coverage data uploaded to coveralls.io - push: - branches: - - main pull_request: branches: - main @@ -22,10 +18,7 @@ jobs: steps: - name: Repository checkout uses: actions/checkout@v2 - if: github.event_name == 'pull_request' || matrix.run_phase == 'GCC' - name: Install build dependencies run: sudo -E .github/workflows/unit_tests.sh SETUP - if: github.event_name == 'pull_request' || matrix.run_phase == 'GCC' - name: Build & test (${{ matrix.run_phase }}) run: sudo -E .github/workflows/unit_tests.sh RUN_${{ matrix.run_phase }} - if: github.event_name == 'pull_request' || matrix.run_phase == 'GCC' From 46573ee1319ee8ae5b292a0a737740eca1a68184 Mon Sep 17 00:00:00 2001 From: Frantisek Sumsal Date: Wed, 10 Nov 2021 16:42:07 +0100 Subject: [PATCH 2/3] ci: fix indentation --- .github/workflows/cifuzz.yml | 58 ++++++++++++++++++------------------ 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/.github/workflows/cifuzz.yml b/.github/workflows/cifuzz.yml index 562f296399..18476cb641 100644 --- a/.github/workflows/cifuzz.yml +++ b/.github/workflows/cifuzz.yml @@ -17,32 +17,32 @@ on: branches: - main jobs: - Fuzzing: - runs-on: ubuntu-latest - if: github.repository == 'systemd/systemd' - strategy: - fail-fast: false - matrix: - sanitizer: [address, undefined, memory] - steps: - - name: Build Fuzzers (${{ matrix.sanitizer }}) - id: build - uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master - with: - oss-fuzz-project-name: 'systemd' - dry-run: false - allowed-broken-targets-percentage: 0 - sanitizer: ${{ matrix.sanitizer }} - - name: Run Fuzzers (${{ matrix.sanitizer }}) - uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master - with: - oss-fuzz-project-name: 'systemd' - fuzz-seconds: 600 - dry-run: false - sanitizer: ${{ matrix.sanitizer }} - - name: Upload Crash - uses: actions/upload-artifact@v1 - if: failure() && steps.build.outcome == 'success' - with: - name: ${{ matrix.sanitizer }}-artifacts - path: ./out/artifacts + Fuzzing: + runs-on: ubuntu-latest + if: github.repository == 'systemd/systemd' + strategy: + fail-fast: false + matrix: + sanitizer: [address, undefined, memory] + steps: + - name: Build Fuzzers (${{ matrix.sanitizer }}) + id: build + uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master + with: + oss-fuzz-project-name: 'systemd' + dry-run: false + allowed-broken-targets-percentage: 0 + sanitizer: ${{ matrix.sanitizer }} + - name: Run Fuzzers (${{ matrix.sanitizer }}) + uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master + with: + oss-fuzz-project-name: 'systemd' + fuzz-seconds: 600 + dry-run: false + sanitizer: ${{ matrix.sanitizer }} + - name: Upload Crash + uses: actions/upload-artifact@v1 + if: failure() && steps.build.outcome == 'success' + with: + name: ${{ matrix.sanitizer }}-artifacts + path: ./out/artifacts From 3884837610168e6fb69fc2d5709f6c017a30beb9 Mon Sep 17 00:00:00 2001 From: Frantisek Sumsal Date: Wed, 10 Nov 2021 16:45:12 +0100 Subject: [PATCH 3/3] ci: cancel previous jobs on ref update Let's save the environment (and reduce the number of jobs in GH Actions queues) by cancelling old jobs on a ref update (force push). See: https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#concurrency --- .github/workflows/build_test.yml | 3 +++ .github/workflows/cifuzz.yml | 3 +++ .github/workflows/linter.yml | 3 +++ .github/workflows/mkosi.yml | 3 +++ .github/workflows/unit_tests.yml | 3 +++ 5 files changed, 15 insertions(+) diff --git a/.github/workflows/build_test.yml b/.github/workflows/build_test.yml index 763a9b8025..ae03f591b3 100644 --- a/.github/workflows/build_test.yml +++ b/.github/workflows/build_test.yml @@ -15,6 +15,9 @@ on: jobs: build: runs-on: ubuntu-20.04 + concurrency: + group: ${{ github.workflow }}-${{ matrix.env.COMPILER }}-${{ matrix.env.COMPILER_VERSION }}-${{ github.ref }} + cancel-in-progress: true strategy: fail-fast: false matrix: diff --git a/.github/workflows/cifuzz.yml b/.github/workflows/cifuzz.yml index 18476cb641..2053c11a0f 100644 --- a/.github/workflows/cifuzz.yml +++ b/.github/workflows/cifuzz.yml @@ -20,6 +20,9 @@ jobs: Fuzzing: runs-on: ubuntu-latest if: github.repository == 'systemd/systemd' + concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true strategy: fail-fast: false matrix: diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 1136c0523b..2c3c58ad58 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -13,6 +13,9 @@ jobs: build: name: Lint Code Base runs-on: ubuntu-latest + concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true steps: - name: Repo checkout diff --git a/.github/workflows/mkosi.yml b/.github/workflows/mkosi.yml index 9ae40e316f..11cb3f63b5 100644 --- a/.github/workflows/mkosi.yml +++ b/.github/workflows/mkosi.yml @@ -15,6 +15,9 @@ on: jobs: ci: runs-on: ubuntu-20.04 + concurrency: + group: ${{ github.workflow }}-${{ matrix.distro }}-${{ github.ref }} + cancel-in-progress: true strategy: fail-fast: false matrix: diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index d6c3fafabd..2bb8400fdf 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -11,6 +11,9 @@ on: jobs: build: runs-on: ubuntu-20.04 + concurrency: + group: ${{ github.workflow }}-${{ matrix.run_phase }}-${{ github.ref }} + cancel-in-progress: true strategy: fail-fast: false matrix: