Skip to content

Commit

Permalink
ci: disable on draft PRs
Browse files Browse the repository at this point in the history
  • Loading branch information
wischli committed May 25, 2023
1 parent 21587ef commit 9c3947d
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 19 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/benchmark-check.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
on:
push:
branches: [main, 'release-v**']
branches: [main, "release-v**"]
pull_request:
name: Check Benchmarks
jobs:
tests:
if: "! github.event.pull_request.draft"
name: ${{ matrix.target }}
strategy:
matrix:
Expand Down
16 changes: 9 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
on:
push:
branches: [main, 'release-v**']
branches: [main, "release-v**"]
pull_request:
name: Build
jobs:
matrix_prep:
if: "! github.event.pull_request.draft"
name: matrix-prep
runs-on: 'ubuntu-latest'
runs-on: "ubuntu-latest"
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
Expand All @@ -15,10 +16,11 @@ jobs:
- id: set-matrix
uses: JoshuaTheMiller/conditional-build-matrix@77cdf28e0eb41dd691280520b0bddddbc4654318
with:
inputFile: '.github/workflows/build-matrix.json'
inputFile: ".github/workflows/build-matrix.json"
# we run build-node on every workflow but build-runtime only on pushes to branches
filter: '[?run_on_event==`any` || run_on_event==`${{ github.event_name }}`]'
filter: "[?run_on_event==`any` || run_on_event==`${{ github.event_name }}`]"
build:
if: "! github.event.pull_request.draft"
needs: matrix_prep
strategy:
matrix: ${{fromJson(needs.matrix_prep.outputs.matrix)}}
Expand Down Expand Up @@ -47,8 +49,8 @@ jobs:
- if: startsWith(matrix.target, 'build-runtime')
uses: Swatinem/rust-cache@cb2cf0cc7c5198d3364b9630e2c3d457f160790c
with: # cache the runtime target instead of root target for build-runtime
working-directory: './runtime'
target-dir: './target/srtool'
working-directory: "./runtime"
target-dir: "./target/srtool"
- if: matrix.target == 'build-node'
uses: Swatinem/rust-cache@cb2cf0cc7c5198d3364b9630e2c3d457f160790c
- name: ${{ matrix.target }}
Expand Down Expand Up @@ -79,4 +81,4 @@ jobs:
- if: ${{ matrix.target == 'build-runtime-fast' && matrix.package == 'centrifuge-runtime' }}
name: Publish to GCS
run: |
gsutil cp ./runtime/centrifuge/target/srtool/release/wbuild/centrifuge-runtime/centrifuge_runtime.compact.compressed.wasm gs://centrifuge-artifact-releases/test-parachain/centrifuge_runtime-$(git rev-parse --short HEAD).compact.compressed.wasm
gsutil cp ./runtime/centrifuge/target/srtool/release/wbuild/centrifuge-runtime/centrifuge_runtime.compact.compressed.wasm gs://centrifuge-artifact-releases/test-parachain/centrifuge_runtime-$(git rev-parse --short HEAD).compact.compressed.wasm
1 change: 1 addition & 0 deletions .github/workflows/docker-nix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# branches: [main, 'release-v**']
# jobs:
# docker:
#
# strategy:
# matrix:
# os: [ ubuntu-latest ]
Expand Down
13 changes: 7 additions & 6 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
name: docker
on:
push:
branches: [main, 'release-v**']
branches: [main, "release-v**"]
pull_request:
paths:
- ".github/workflows/docker.yml"
workflow_dispatch:
inputs:
docker_tag:
description: 'Docker Image tag'
description: "Docker Image tag"
required: true
default: ''
default: ""
env:
RUST_TOOLCHAIN: "nightly-2022-11-14"
jobs:
docker:
if: "! github.event.pull_request.draft"
strategy:
matrix:
os: [ ubuntu-latest-4-cores ]
target: [ release, test ]
os: [ubuntu-latest-4-cores]
target: [release, test]
runs-on: ${{ matrix.os }}
env:
WORKFLOW_TAG: ${{ github.event.inputs.docker_tag }}
Expand All @@ -27,7 +28,7 @@ jobs:
with:
fetch-depth: 0
- name: Free space
# https://github.com/actions/runner-images/issues/2840#issuecomment-1284059930
# https://github.com/actions/runner-images/issues/2840#issuecomment-1284059930
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
pull_request:
jobs:
docs:
if: "! github.event.pull_request.draft"
permissions:
contents: write
runs-on: ubuntu-latest
Expand All @@ -31,7 +32,7 @@ jobs:
with:
command: doc
args: --all --no-deps

- name: Build Documentation failed
if: always() && steps.build_docs.outcome == 'failure'
run: echo ":::error::cargo doc --all --no-deps failed"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lints.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
on:
push:
branches: [main, 'release-v**']
branches: [main, "release-v**"]
pull_request:
name: Lints
jobs:
lints:
if: "! github.event.pull_request.draft"
name: ${{ matrix.target }}
strategy:
matrix:
Expand Down Expand Up @@ -42,4 +43,3 @@ jobs:
run: ./ci/script.sh
env:
TARGET: ${{ matrix.target }}

4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
on:
push:
branches: [main, 'release-v**']
branches: [main, "release-v**"]
pull_request:
name: Tests
jobs:
tests:
if: "! github.event.pull_request.draft"
name: ${{ matrix.target }}
strategy:
matrix:
Expand Down Expand Up @@ -36,4 +37,3 @@ jobs:
run: ./ci/script.sh
env:
TARGET: ${{ matrix.target }}

0 comments on commit 9c3947d

Please sign in to comment.