Skip to content

Commit

Permalink
Cleanup Workflows [IGNORE INTERMEDIATE BUILDS][SAME VERSION] (#155)
Browse files Browse the repository at this point in the history
* don't persist github creds and remove setup.sh from workflows
  • Loading branch information
kate-goldenring committed Dec 3, 2020
1 parent f8dae70 commit 066b500
Show file tree
Hide file tree
Showing 12 changed files with 57 additions and 21 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/build-agent-container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ on:
- build/containers/Dockerfile.agent
- agent/**
- shared/**
- build/setup.sh
- version.txt
- build/akri-containers.mk
- Makefile
Expand All @@ -23,7 +22,6 @@ on:
- build/containers/Dockerfile.agent
- agent/**
- shared/**
- build/setup.sh
- version.txt
- build/akri-containers.mk
- Makefile
Expand All @@ -36,7 +34,6 @@ on:
- build/containers/Dockerfile.agent
- agent/**
- shared/**
- build/setup.sh
- version.txt
- build/akri-containers.mk
- Makefile
Expand Down Expand Up @@ -74,10 +71,13 @@ jobs:
# of the pull request, so the default ref is master branch and
# ref should be manually set to the head of the PR
ref: refs/pull/${{ github.event.pull_request.number }}/head
persist-credentials: false

- name: Checkout the head commit of the branch
if: ${{ github.event_name != 'pull_request_target' }}
uses: actions/checkout@v2
with:
persist-credentials: false

- name: Prepare To Install
uses: actions/setup-node@v1
Expand Down Expand Up @@ -115,6 +115,8 @@ jobs:
steps:
- name: Checkout repo
uses: actions/checkout@v2
with:
persist-credentials: false

- name: Prepare To Install
uses: actions/setup-node@v1
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/build-controller-container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ on:
- build/containers/Dockerfile.controller
- controller/**
- shared/**
- build/setup.sh
- version.txt
- build/akri-containers.mk
- Makefile
Expand All @@ -23,7 +22,6 @@ on:
- build/containers/Dockerfile.controller
- controller/**
- shared/**
- build/setup.sh
- version.txt
- build/akri-containers.mk
- Makefile
Expand All @@ -36,7 +34,6 @@ on:
- build/containers/Dockerfile.controller
- controller/**
- shared/**
- build/setup.sh
- version.txt
- build/akri-containers.mk
- Makefile
Expand Down Expand Up @@ -73,10 +70,13 @@ jobs:
# of the pull request, so the default ref is master branch and
# ref should be manually set to the head of the PR
ref: refs/pull/${{ github.event.pull_request.number }}/head
persist-credentials: false

- name: Checkout the head commit of the branch
if: ${{ github.event_name != 'pull_request_target' }}
uses: actions/checkout@v2
with:
persist-credentials: false

- name: Prepare To Install
uses: actions/setup-node@v1
Expand Down Expand Up @@ -114,6 +114,8 @@ jobs:
steps:
- name: Checkout repo
uses: actions/checkout@v2
with:
persist-credentials: false

- name: Prepare To Install
uses: actions/setup-node@v1
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/build-onvif-video-broker-container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,13 @@ jobs:
# of the pull request, so the default ref is master branch and
# ref should be manually set to the head of the PR
ref: refs/pull/${{ github.event.pull_request.number }}/head
persist-credentials: false

- name: Checkout the head commit of the branch
if: ${{ github.event_name != 'pull_request_target' }}
uses: actions/checkout@v2
with:
persist-credentials: false

- name: Prepare To Install
uses: actions/setup-node@v1
Expand Down Expand Up @@ -109,6 +112,8 @@ jobs:
steps:
- name: Checkout repo
uses: actions/checkout@v2
with:
persist-credentials: false

- name: Prepare To Install
uses: actions/setup-node@v1
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/build-opencv-base-container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,13 @@ jobs:
# of the pull request, so the default ref is master branch and
# ref should be manually set to the head of the PR
ref: refs/pull/${{ github.event.pull_request.number }}/head
persist-credentials: false

- name: Checkout the head commit of the branch
if: ${{ github.event_name != 'pull_request_target' }}
uses: actions/checkout@v2
with:
persist-credentials: false

- name: Akri intermediate builds are LONG running and should only be run when absolutely needed
if: >-
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/build-rust-crossbuild-container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,13 @@ jobs:
# of the pull request, so the default ref is master branch and
# ref should be manually set to the head of the PR
ref: refs/pull/${{ github.event.pull_request.number }}/head
persist-credentials: false

- name: Checkout the head commit of the branch
if: ${{ github.event_name != 'pull_request_target' }}
uses: actions/checkout@v2
with:
persist-credentials: false

- name: Akri intermediate builds are LONG running and should only be run when absolutely needed
if: >-
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/build-udev-video-broker-container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ on:
- build/containers/Dockerfile.udev-video-broker
- samples/brokers/udev-video-broker/**
- shared/**
- build/setup.sh
- version.txt
- build/akri-containers.mk
- Makefile
Expand All @@ -23,7 +22,6 @@ on:
- build/containers/Dockerfile.udev-video-broker
- samples/brokers/udev-video-broker/**
- shared/**
- build/setup.sh
- version.txt
- build/akri-containers.mk
- Makefile
Expand All @@ -36,7 +34,6 @@ on:
- build/containers/Dockerfile.udev-video-broker
- samples/brokers/udev-video-broker/**
- shared/**
- build/setup.sh
- version.txt
- build/akri-containers.mk
- Makefile
Expand Down Expand Up @@ -74,10 +71,13 @@ jobs:
# of the pull request, so the default ref is master branch and
# ref should be manually set to the head of the PR
ref: refs/pull/${{ github.event.pull_request.number }}/head
persist-credentials: false

- name: Checkout the head commit of the branch
if: ${{ github.event_name != 'pull_request_target' }}
uses: actions/checkout@v2
with:
persist-credentials: false

- name: Prepare To Install
uses: actions/setup-node@v1
Expand Down Expand Up @@ -115,6 +115,8 @@ jobs:
steps:
- name: Checkout repo
uses: actions/checkout@v2
with:
persist-credentials: false

- name: Prepare To Install
uses: actions/setup-node@v1
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/build-video-streaming-app-container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,13 @@ jobs:
# of the pull request, so the default ref is master branch and
# ref should be manually set to the head of the PR
ref: refs/pull/${{ github.event.pull_request.number }}/head
persist-credentials: false

- name: Checkout the head commit of the branch
if: ${{ github.event_name != 'pull_request_target' }}
uses: actions/checkout@v2
with:
persist-credentials: false

- name: Prepare To Install
uses: actions/setup-node@v1
Expand Down Expand Up @@ -109,6 +112,8 @@ jobs:
steps:
- name: Checkout repo
uses: actions/checkout@v2
with:
persist-credentials: false

- name: Prepare To Install
uses: actions/setup-node@v1
Expand Down
14 changes: 9 additions & 5 deletions .github/workflows/check-rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,20 @@ on:
- '**.rs'
- '**/Cargo.toml'
- '**/Cargo.lock'
- build/setup.sh
pull_request:
branches: [ main ]
paths:
- .github/workflows/check-rust.yml
- '**.rs'
- '**/Cargo.toml'
- '**/Cargo.lock'
- build/setup.sh
pull_request_target:
branches: [ main ]
paths:
- .github/workflows/check-rust.yml
- '**.rs'
- '**/Cargo.toml'
- '**/Cargo.lock'
- build/setup.sh

env:
CARGO_TERM_COLOR: always
Expand All @@ -49,19 +46,26 @@ jobs:
# of the pull request, so the default ref is master branch and
# ref should be manually set to the head of the PR
ref: refs/pull/${{ github.event.pull_request.number }}/head
persist-credentials: false

- name: Checkout the head commit of the branch
if: ${{ github.event_name != 'pull_request_target' }}
uses: actions/checkout@v2
with:
persist-credentials: false

- name: Rust install
uses: actions-rs/toolchain@v1
with:
toolchain: 1.41.0
override: true
components: clippy, rustfmt
- name: Install linux requirement
run: ./build/setup.sh
- name: Install Linux requirements
run: |
apt_dependencies="git curl libssl-dev pkg-config libudev-dev libv4l-dev"
echo "Run apt update and apt install the following dependencies: $apt_dependencies"
sudo apt update
sudo apt install -y $apt_dependencies
- name: Check rust format
run: cargo fmt --all -- --check
- name: Check clippy
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/check-versioning.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,13 @@ jobs:
# of the pull request, so the default ref is master branch and
# ref should be manually set to the head of the PR
ref: refs/pull/${{ github.event.pull_request.number }}/head
persist-credentials: false

- name: Checkout the head commit of the branch
if: ${{ github.event_name != 'pull_request_target' }}
uses: actions/checkout@v2
with:
persist-credentials: false

# Only run version check for PRs. If PR title does NOT contain "[SAME VERSION]", then ensure that
# version.txt is different from what is in main.
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/run-helm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,13 @@ jobs:
# of the pull request, so the default ref is master branch and
# ref should be manually set to the head of the PR
ref: refs/pull/${{ github.event.pull_request.number }}/head
persist-credentials: false

- name: Checkout the head commit of the branch
if: ${{ github.event_name != 'pull_request_target' }}
uses: actions/checkout@v2
with:
persist-credentials: false

- uses: azure/setup-helm@v1

Expand All @@ -71,10 +74,13 @@ jobs:
# of the pull request, so the default ref is master branch and
# ref should be manually set to the head of the PR
ref: refs/pull/${{ github.event.pull_request.number }}/head
persist-credentials: false

- name: Checkout the head commit of the branch
if: ${{ github.event_name != 'pull_request_target' }}
uses: actions/checkout@v2
with:
persist-credentials: false

- uses: azure/setup-helm@v1
with:
Expand Down Expand Up @@ -123,6 +129,7 @@ jobs:
uses: actions/checkout@v2
with:
ref: gh-pages
persist-credentials: false

- name: Get new chart from artifact path
if: (github.event_name == 'release') || (github.event_name == 'push' && github.ref == 'refs/heads/main') || (startsWith(github.event_name, 'pull_request') && github.event.action == 'closed' && github.event.pull_request.merged == true && github.ref != 'refs/heads/main')
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/run-tarpaulin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,18 @@ on:
- .github/workflows/run-tarpaulin.yml
- '**.rs'
- '**/Cargo.toml'
- build/setup.sh
pull_request:
branches: [ main ]
paths:
- .github/workflows/run-tarpaulin.yml
- '**.rs'
- '**/Cargo.toml'
- build/setup.sh
pull_request_target:
branches: [ main ]
paths:
- .github/workflows/run-tarpaulin.yml
- '**.rs'
- '**/Cargo.toml'
- build/setup.sh

env:
CARGO_TERM_COLOR: always
Expand All @@ -45,10 +42,13 @@ jobs:
# of the pull request, so the default ref is master branch and
# ref should be manually set to the head of the PR
ref: refs/pull/${{ github.event.pull_request.number }}/head
persist-credentials: false

- name: Checkout the head commit of the branch
if: ${{ github.event_name != 'pull_request_target' }}
uses: actions/checkout@v2
with:
persist-credentials: false

- name: Log into dockerhub to avoid throttled anonymous dockerhub pulls
run: echo "${{ secrets.DHPASSWORD }}" | docker login --username "${{ secrets.DHUSERNAME }}" --password-stdin
Expand All @@ -57,7 +57,7 @@ jobs:
- name: Start tarpaulin instance
run: docker start $(cat container_id.txt)
- name: Install linux requirement in tarpaulin instance
run: docker exec $(cat container_id.txt) sh -c "./build/setup.sh"
run: docker exec $(cat container_id.txt) sh -c "echo Run apt update and apt install the following dependencies - git curl libssl-dev pkg-config libudev-dev libv4l-dev ; apt update ; apt install -y git curl libssl-dev pkg-config libudev-dev libv4l-dev"
- name: Install rust requirements in tarpaulin instance
run: docker exec $(cat container_id.txt) sh -c "rustup component add rustfmt"
- name: Run tarpaulin
Expand Down

0 comments on commit 066b500

Please sign in to comment.