Skip to content

Commit

Permalink
Merge pull request #684 from umarcor/ci/txt
Browse files Browse the repository at this point in the history
ci: add 'releasing/supported_bases.txt'
  • Loading branch information
mithro authored Feb 24, 2021
2 parents 529f17d + cac8067 commit 6a222b2
Show file tree
Hide file tree
Showing 12 changed files with 322 additions and 309 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/generate-matrix.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/usr/bin/env python3

# Copyright 2021 The Verible Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from pathlib import Path

matrix = []

with (Path(__file__).parent.resolve().parent.parent / 'releasing' / 'supported_bases.txt').open('r') as fptr:
for items in [line.strip().split(':') for line in fptr.readlines()]:
matrix.append({
'os': items[0],
'ver': items[1]
})

print('::set-output name=matrix::' + str(matrix))
29 changes: 20 additions & 9 deletions .github/workflows/verible-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
pull_request:

env:
DOCKER_BUILDKIT: 1
BOT_USER: "Deployment Bot"
BOT_EMAIL: "[email protected]"

Expand All @@ -15,6 +16,7 @@ jobs:
runs-on: ubuntu-20.04

steps:

- name: Checkout code
uses: actions/checkout@v2
with:
Expand All @@ -41,7 +43,9 @@ jobs:
env:
MODE: ${{ matrix.mode }}
name: Check · ${{ matrix.mode }}

steps:

- name: Checkout code
uses: actions/checkout@v2
with:
Expand Down Expand Up @@ -84,6 +88,7 @@ jobs:
runs-on: ubuntu-20.04

steps:

- name: Checkout code
uses: actions/checkout@v2
with:
Expand Down Expand Up @@ -116,21 +121,24 @@ jobs:
source ./.github/settings.sh
./.github/workflows/run-kythe.sh
- name: Upload Kythe output
- name: 📤 Upload Kythe output
uses: actions/upload-artifact@v2
with:
name: verible-kythe-index
path: kythe_output/*.kzip


Matrix:
runs-on: ubuntu-latest
name: Generate Build matrix
outputs:
matrix: ${{ steps.generate.outputs.matrix }}

steps:

- uses: actions/checkout@v2

- id: generate
run: ./.github/workflows/generate_matrix.sh
run: ./.github/workflows/generate-matrix.py


Build:
Expand All @@ -140,22 +148,24 @@ jobs:
fail-fast: false
matrix:
include: ${{ fromJson(needs.Matrix.outputs.matrix) }}
name: Build · ${{ matrix.os }} ${{ matrix.version }}
env:
MATRIX_OS: '${{ matrix.os }}:${{ matrix.ver }}'
name: 'Build · ${{ matrix.os }}:${{ matrix.ver }}'

steps:

- uses: actions/checkout@v2
with:
# Download complete repository + tags
fetch-depth: 0

- run: docker pull ${{ matrix.os }}:${{ matrix.version }}
- run: docker pull $MATRIX_OS

- name: Main script
run: |
set -x
source ./.github/settings.sh
cd releasing
./docker-run.sh ${{ matrix.os }}-${{ matrix.version }}
./releasing/docker-run.sh $MATRIX_OS
- name: 📤 Upload artifact
uses: actions/upload-artifact@v2
Expand All @@ -167,6 +177,7 @@ jobs:
needs: [ Check, Build ]
runs-on: ubuntu-20.04
name: 📦 Release

steps:

- uses: actions/checkout@v2
Expand All @@ -177,7 +188,7 @@ jobs:
- name: 📥 Download artifacts
uses: actions/download-artifact@v2

- name: After success
- name: Generate and apply TAG
run: |
git config --local user.name "$BOT_USER"
git config --local user.email "$BOT_EMAIL"
Expand All @@ -190,7 +201,7 @@ jobs:
ls -lah artifact
- name: Deployment
- name: Deploy release and assets
if: github.ref == 'refs/heads/master' && github.event_name != 'pull_request'
uses: svenstaro/upload-release-action@v2
with:
Expand Down
14 changes: 5 additions & 9 deletions .github/workflows/generate_matrix.sh → releasing/build.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env bash
# Copyright 2020 The Verible Authors.

# Copyright 2021 The Verible Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -15,12 +16,7 @@

set -e

matrix='['
for item in releasing/*/; do
matrix+='{"os": "'"`echo $(basename $item) | cut -d- -f1`"'", "version": "'"`echo $(basename $item) | cut -d- -f2`"'"},'
done
matrix+=']'

echo "$matrix"
cd $(dirname "$0")/..

echo "::set-output name=matrix::$matrix"
./.github/workflows/github-pages-setup.sh
./.github/workflows/github-releases-setup.sh /out
Empty file removed releasing/centos-7/.keepme
Empty file.
Empty file removed releasing/centos-8/.keepme
Empty file.
Loading

0 comments on commit 6a222b2

Please sign in to comment.