Skip to content

Commit

Permalink
Update workflows (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
fgalind1 authored Oct 6, 2021
1 parent c4b6d28 commit 75f5ec8
Show file tree
Hide file tree
Showing 6 changed files with 104 additions and 68 deletions.
36 changes: 0 additions & 36 deletions .github/workflows/codeql.yml

This file was deleted.

49 changes: 49 additions & 0 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Pull Request

on:
pull_request:
branches:
- main
- releases/*

env:
DOTNET_SYSTEM_GLOBALIZATION_INVARIANT: 1

jobs:
build:
strategy:
matrix:
runtime: [ linux-x64 ]
include:
- runtime: linux-x64
container: ubuntu:20.04
devScript: ./dev.sh

runs-on: self-hosted
container: ${{ matrix.container }}
steps:
- uses: actions/checkout@v1

- name: Install dependencies
run: |
${{ matrix.devScript }} dependencies ${{ matrix.runtime }}
working-directory: src

# Build runner layout
- name: Build & Layout Release
run: |
${{ matrix.devScript }} layout Release ${{ matrix.runtime }}
working-directory: src

# Run tests
- name: L0
run: |
${{ matrix.devScript }} test
working-directory: src
if: matrix.runtime != 'linux-arm64' && matrix.runtime != 'linux-arm'

# Create runner package tar.gz/zip
- name: Package Release
run: |
${{ matrix.devScript }} package Release
working-directory: src
43 changes: 13 additions & 30 deletions .github/workflows/build.yml → .github/workflows/push.yml
Original file line number Diff line number Diff line change
@@ -1,49 +1,34 @@
name: Runner CI
name: Push

on:
workflow_dispatch:
push:
branches:
- main
- releases/*
paths-ignore:
- '**.md'
pull_request:
branches:
- '*'
paths-ignore:
- '**.md'

env:
DOTNET_SYSTEM_GLOBALIZATION_INVARIANT: 1

jobs:
build:
strategy:
matrix:
runtime: [ linux-x64, linux-arm64, linux-arm, win-x64, osx-x64 ]
runtime: [ linux-x64 ]
include:
- runtime: linux-x64
os: ubuntu-latest
devScript: ./dev.sh

- runtime: linux-arm64
os: ubuntu-latest
devScript: ./dev.sh

- runtime: linux-arm
os: ubuntu-latest
container: ubuntu:20.04
devScript: ./dev.sh

- runtime: osx-x64
os: macOS-latest
devScript: ./dev.sh

- runtime: win-x64
os: windows-latest
devScript: ./dev

runs-on: ${{ matrix.os }}
runs-on: self-hosted
container: ${{ matrix.container }}
steps:
- uses: actions/checkout@v1

- name: Install dependencies
run: |
${{ matrix.devScript }} dependencies ${{ matrix.runtime }}
working-directory: src

# Build runner layout
- name: Build & Layout Release
run: |
Expand All @@ -59,14 +44,12 @@ jobs:

# Create runner package tar.gz/zip
- name: Package Release
if: github.event_name != 'pull_request'
run: |
${{ matrix.devScript }} package Release
working-directory: src

# Upload runner package tar.gz/zip as artifact
- name: Publish Artifact
if: github.event_name != 'pull_request'
uses: actions/upload-artifact@v1
with:
name: runner-package-${{ matrix.runtime }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Runner CD
name: Release

on:
workflow_dispatch:
Expand Down
29 changes: 29 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
VERSION?=0.0.0-dev
WORKSPACE ?= $(shell pwd)

DOCKER ?= docker

DOCKER_REGISTRY?=amr-registry.caas.intel.com
DOCKER_IMAGES_PREFIX?=1source/github-actions
DOCKER_BASE_IMAGE?=${DOCKER_REGISTRY}/${DOCKER_IMAGES_PREFIX}
DOCKER_USERNAME?=
DOCKER_PASSWORD?=

DOCKER_USER=$(shell sh -c "id -u")
DOCKER_GROUP=$(shell sh -c "id -g")

ifneq ($(GITHUB_ACTIONS),)
DOCKER_USER_ARGS =
else
DOCKER_USER_ARGS = --user=$(DOCKER_USER):$(DOCKER_GROUP)
endif

UBUNTU?=$(DOCKER) run -e DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1 -e RUNTIME=linux-x64 -v $(WORKSPACE):/workspace -w /workspace/src ubuntu:20.04

.PHONY: build
build:
$(UBUNTU) bash -c ''' \
./dev.sh dependencies $$RUNTIME && \
./dev.sh layout Release $$RUNTIME && \
./dev.sh test && \
./dev.sh package Release'''
13 changes: 12 additions & 1 deletion src/dev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#
###############################################################################

set -e
set -ex

DEV_CMD=$1
DEV_CONFIG=$2
Expand Down Expand Up @@ -129,6 +129,12 @@ function layout ()
bash ./Misc/externals.sh $RUNTIME_ID || checkRC externals.sh
}

function dependencies ()
{
apt-get update
apt-get install curl git -y
}

function runtest ()
{
heading "Testing ..."
Expand Down Expand Up @@ -176,6 +182,11 @@ function package ()
popd > /dev/null
}

if [[ $DEV_CMD == "dependencies" ]]; then
dependencies
exit
fi

if [[ (! -d "${DOTNETSDK_INSTALLDIR}") || (! -e "${DOTNETSDK_INSTALLDIR}/.${DOTNETSDK_VERSION}") || (! -e "${DOTNETSDK_INSTALLDIR}/dotnet") ]]; then

# Download dotnet SDK to ../_dotnetsdk directory
Expand Down

0 comments on commit 75f5ec8

Please # to comment.