Skip to content

Commit

Permalink
Drop flat-repo sub action and REPO_PATH
Browse files Browse the repository at this point in the history
The repository is generated/updated as part of the build step
  • Loading branch information
rhaschke committed Sep 10, 2023
1 parent 593c773 commit ef8b304
Show file tree
Hide file tree
Showing 11 changed files with 7 additions and 145 deletions.
13 changes: 1 addition & 12 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ on:

env:
DEBS_PATH: ${{ inputs.DEBS_PATH || vars.DEBS_PATH || '~/debs' }}
REPO_PATH: ${{ inputs.REPO_PATH || vars.REPO_PATH || '~/repo' }}
TERM: xterm # needed for colored output of unittests

concurrency:
Expand Down Expand Up @@ -94,17 +93,7 @@ jobs:
ROS_SOURCES: .github/workflows/minimal.repos

- name: Upload debs
uses: actions/upload-artifact@v3
with:
name: minimal-${{ matrix.DEB_DISTRO }}-${{ matrix.ROS_DISTRO }}.debs
path: ${{ env.DEBS_PATH }}

- name: Run flat-repo action
uses: ./flat-repo

- name: Upload repo
uses: actions/upload-artifact@v3
with:
name: minimal-${{ matrix.DEB_DISTRO }}-${{ matrix.ROS_DISTRO }}
path: ${{ env.REPO_PATH }} # upload cannot interpret $REPO_PATH
if-no-files-found: error
path: ${{ env.DEBS_PATH }}
38 changes: 0 additions & 38 deletions .github/workflows/generic.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,6 @@ on:
description: path to store generated .debs in
required: false

REPO_PATH:
type: string
description: path to generate package repository in
required: false

DEPLOY_URL:
type: string
description: repository URL for deployment
Expand All @@ -95,7 +90,6 @@ env:
EXTRA_ROSDEP_SOURCES: ${{ inputs.EXTRA_ROSDEP_SOURCES || vars.EXTRA_ROSDEP_SOURCES }}

DEBS_PATH: ${{ inputs.DEBS_PATH || vars.DEBS_PATH || '~/debs' }}
REPO_PATH: ${{ inputs.REPO_PATH || vars.REPO_PATH || '~/repo' }}

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
Expand Down Expand Up @@ -159,35 +153,3 @@ jobs:
name: debs
path: ${{ env.DEBS_PATH }}
if-no-files-found: error

repo:
needs: debs
runs-on: ubuntu-latest
name: create repo
if: (inputs.DEPLOY_URL || vars.DEPLOY_URL) && (inputs.DEPLOY_URL != 'skip')

env: # define common environment variables (cannot be passed from calling workflow)
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 10
DEBUG_BASH: ${{ secrets.ACTIONS_STEP_DEBUG && 'true' || 'false' }}
DEPLOY_URL:: ${{ inputs.DEPLOY_URL || vars.DEPLOY_URL }}
BRANCH: "${{ inputs.BRANCH || \
format('{0}-{1}', inputs.DEB_DISTRO || vars.DEB_DISTRO || 'jammy', \
inputs.ROS_DISTRO || vars.ROS_DISTRO || 'one') }}"

steps:
- name: Download debs from build
uses: actions/download-artifact@v3
with:
name: debs
path: ${{ env.DEBS_PATH }}

- name: Run flat-repo action
uses: ubi-agni/ros-builder-action/flat-repo@main

- name: Upload repo
uses: actions/upload-artifact@v3
if: always() # upload on timeout or cancel too
with:
name: repo
path: ${{ env.REPO_PATH }}
if-no-files-found: error
6 changes: 3 additions & 3 deletions .github/workflows/interactive.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,15 @@ jobs:

env: # define common environment variables (cannot be passed from calling workflow)
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 10
FOLDER: ${{ vars.REPO_PATH || '~/repo' }}
FOLDER: ${{ vars.DEBS_PATH || '~/debs' }}
REPO: ${{ vars.DEPLOY_URL }}
BRANCH: ${{ inputs.BRANCH || format('{0}-{1}', inputs.DEB_DISTRO, inputs.ROS_DISTRO) }}

steps:
- name: Download repo from build
- name: Download debs from build
uses: actions/download-artifact@v3
with:
name: repo
name: debs
path: ${{ env.FOLDER }}

- name: Deploy
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/splitted.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,15 @@ jobs:

env: # define common environment variables (cannot be passed from calling workflow)
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 10
FOLDER: ${{ vars.REPO_PATH || '~/repo' }}
FOLDER: ${{ vars.DEBS_PATH || '~/debs' }}
REPO: ${{ vars.DEPLOY_URL }}
BRANCH: ${{ inputs.BRANCH || format('{0}-{1}', inputs.DEB_DISTRO, inputs.ROS_DISTRO) }}

steps:
- name: Download repo from build
- name: Download debs from build
uses: actions/download-artifact@v3
with:
name: repo
name: debs
path: ${{ env.FOLDER }}

- name: Deploy
Expand Down
26 changes: 0 additions & 26 deletions flat-repo/action.yaml

This file was deleted.

40 changes: 0 additions & 40 deletions flat-repo/flat-repo.js

This file was deleted.

18 changes: 0 additions & 18 deletions flat-repo/flat-repo.sh

This file was deleted.

2 changes: 0 additions & 2 deletions src/env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ export DEB_BUILD_OPTIONS=${DEB_BUILD_OPTIONS:-nocheck} # don't build/run tests
## deploy paths: 'eval echo ...' expands environment variables
export DEBS_PATH
DEBS_PATH=$(eval echo "${DEBS_PATH}")
export REPO_PATH
REPO_PATH=$(eval echo "${REPO_PATH}")

export GITHUB_TOKEN=${GITHUB_TOKEN:-}

Expand Down
1 change: 0 additions & 1 deletion src/scripts/generic.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ EXTRA_SBUILD_CONFIG=$EXTRA_SBUILD_CONFIG
CONTINUE_ON_ERROR=$CONTINUE_ON_ERROR
DEBS_PATH=$DEBS_PATH
REPO_PATH=$REPO_PATH
DEBUG_BASH=$DEBUG_BASH
EOF
Expand Down
1 change: 0 additions & 1 deletion test/prepare.bats
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ function setup {
DIR="$( cd "$( dirname "$BATS_TEST_FILENAME" )" >/dev/null 2>&1 && pwd )"
SRC_PATH=$(realpath "$DIR/../src")
DEBS_PATH=${DEBS_PATH:-~/debs}
REPO_PATH=${REPO_PATH:-~/repo}

# shellcheck source=src/env.sh
source "${SRC_PATH}/env.sh"
Expand Down
1 change: 0 additions & 1 deletion test/util.bats
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ function setup {
DIR="$( cd "$( dirname "$BATS_TEST_FILENAME" )" >/dev/null 2>&1 && pwd )"
SRC_PATH=$(realpath "$DIR/../src")
DEBS_PATH=${DEBS_PATH:-~/debs}
REPO_PATH=${REPO_PATH:-~/repo}

# shellcheck source=src/env.sh
source "${SRC_PATH}/env.sh"
Expand Down

0 comments on commit ef8b304

Please sign in to comment.