Skip to content

Commit

Permalink
Update the build process to build using the base container image
Browse files Browse the repository at this point in the history
and remove the necessity to handle the dependencies during the
build time

Signed-off-by: Rafael Sene <[email protected]>
  • Loading branch information
rpsene committed Sep 11, 2023
1 parent 586c72a commit 1edd16b
Show file tree
Hide file tree
Showing 23 changed files with 233 additions and 244 deletions.
69 changes: 23 additions & 46 deletions .github/workflows/build-connectors.yaml
Original file line number Diff line number Diff line change
@@ -1,61 +1,38 @@
# This workflow installs dependencies for PDF generation, generates the PDF,
# and uploads the PDF as an artifact.

name: Build RISC-V-Trace-Connectors.pdf

on:
push:
branches:
- master
- main
pull_request:
branches:
- master
- main
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest

env:
APT_PACKAGES_FILE: ${{ github.workspace }}/dependencies/apt_packages.txt
BUNDLE_GEMFILE: ${{ github.workspace }}/dependencies/Gemfile
BUNDLE_BIN: ${{ github.workspace }}/bin
NPM_PACKAGE_FOLDER: ${{ github.workspace }}/dependencies
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: 'true'
- name: Install Ubuntu packages
run: |
sudo apt-get update
grep -vE '^#' ${APT_PACKAGES_FILE} | xargs sudo apt-get install --yes --no-install-recommends
# Ruby for asciidoctor
- name: Setup Ruby and Gemfile content
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.2.0"
bundler-cache: true
# Node.js for wavedrom
- uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '16'
- name: Install Node.js dependencies
run: npm install ${NPM_PACKAGE_FOLDER}
- name: Generate PDF
run: |
PATH=${PATH}:${BUNDLE_BIN}:$(npm bin):$(pwd) \
make -C docs/ RISC-V-Trace-Connectors.pdf
- name: Archive PDF result
uses: actions/upload-artifact@v3
with:
name: RISC-V-Trace-Connectors
path: docs/RISC-V-Trace-Connectors.pdf
retention-days: 7
# Step 1: Checkout the repository
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: 'recursive'

# Step 2: Pull the latest RISC-V Docs container image
- name: Pull Container
run: docker pull riscvintl/riscv-docs-base-container-image:latest

# Step 3: Build Files
- name: Build Files
run: cd ./docs && make RISC-V-Trace-Connectors.pdf

# Step 4: Upload the built PDF files as independent artifacts
- name: Upload RISC-V-Trace-Control-Interface PDF
uses: actions/upload-artifact@v3
with:
name: RISC-V-Trace-Control-Interface
path: ${{ github.workspace }}/docs/RISC-V-Trace-Connectors.pdf
retention-days: 7
69 changes: 23 additions & 46 deletions .github/workflows/build-control.yaml
Original file line number Diff line number Diff line change
@@ -1,61 +1,38 @@
# This workflow installs dependencies for PDF generation, generates the PDF,
# and uploads the PDF as an artifact.

name: Build RISC-V-Trace-Control-Interface.pdf

on:
push:
branches:
- master
- main
pull_request:
branches:
- master
- main
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest

env:
APT_PACKAGES_FILE: ${{ github.workspace }}/dependencies/apt_packages.txt
BUNDLE_GEMFILE: ${{ github.workspace }}/dependencies/Gemfile
BUNDLE_BIN: ${{ github.workspace }}/bin
NPM_PACKAGE_FOLDER: ${{ github.workspace }}/dependencies
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: 'true'
- name: Install Ubuntu packages
run: |
sudo apt-get update
grep -vE '^#' ${APT_PACKAGES_FILE} | xargs sudo apt-get install --yes --no-install-recommends
# Ruby for asciidoctor
- name: Setup Ruby and Gemfile content
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.2.0"
bundler-cache: true
# Node.js for wavedrom
- uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '16'
- name: Install Node.js dependencies
run: npm install ${NPM_PACKAGE_FOLDER}
- name: Generate PDF
run: |
PATH=${PATH}:${BUNDLE_BIN}:$(npm bin):$(pwd) \
make -C docs/ RISC-V-Trace-Control-Interface.pdf
- name: Archive PDF result
uses: actions/upload-artifact@v3
with:
name: RISC-V-Trace-Control-Interface
path: docs/RISC-V-Trace-Control-Interface.pdf
retention-days: 7
# Step 1: Checkout the repository
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: 'recursive'

# Step 2: Pull the latest RISC-V Docs container image
- name: Pull Container
run: docker pull riscvintl/riscv-docs-base-container-image:latest

# Step 3: Build Files
- name: Build Files
run: cd ./docs && make RISC-V-Trace-Control-Interface.pdf

# Step 4: Upload the built PDF files as independent artifacts
- name: Upload RISC-V-Trace-Control-Interface PDF
uses: actions/upload-artifact@v3
with:
name: RISC-V-Trace-Control-Interface
path: ${{ github.workspace }}/docs/RISC-V-Trace-Control-Interface.pdf
retention-days: 7
71 changes: 24 additions & 47 deletions .github/workflows/build-n-trace.yaml
Original file line number Diff line number Diff line change
@@ -1,61 +1,38 @@
# This workflow installs dependencies for PDF generation, generates the PDF,
# and uploads the PDF as an artifact.

name: Build RISC-V-N-Trace.pdf
name: Build Build RISC-V-N-Trace.pdf

on:
push:
branches:
- master
- main
pull_request:
branches:
- master
- main
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest

env:
APT_PACKAGES_FILE: ${{ github.workspace }}/dependencies/apt_packages.txt
BUNDLE_GEMFILE: ${{ github.workspace }}/dependencies/Gemfile
BUNDLE_BIN: ${{ github.workspace }}/bin
NPM_PACKAGE_FOLDER: ${{ github.workspace }}/dependencies
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: 'true'
- name: Install Ubuntu packages
run: |
sudo apt-get update
grep -vE '^#' ${APT_PACKAGES_FILE} | xargs sudo apt-get install --yes --no-install-recommends
# Ruby for asciidoctor
- name: Setup Ruby and Gemfile content
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.2.0"
bundler-cache: true
# Node.js for wavedrom
- uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '16'
- name: Install Node.js dependencies
run: npm install ${NPM_PACKAGE_FOLDER}
- name: Generate PDF
run: |
PATH=${PATH}:${BUNDLE_BIN}:$(npm bin):$(pwd) \
make -C docs/ RISC-V-N-Trace.pdf
- name: Archive PDF result
uses: actions/upload-artifact@v3
with:
name: RISC-V-N-Trace
path: docs/RISC-V-N-Trace.pdf
retention-days: 7
# Step 1: Checkout the repository
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: 'recursive'

# Step 2: Pull the latest RISC-V Docs container image
- name: Pull Container
run: docker pull riscvintl/riscv-docs-base-container-image:latest

# Step 3: Build Files
- name: Build Files
run: cd ./docs && make RISC-V-N-Trace.pdf

# Step 4: Upload the built PDF files as independent artifacts
- name: Upload RISC-V-Trace-Control-Interface PDF
uses: actions/upload-artifact@v3
with:
name: RISC-V-Trace-Control-Interface
path: ${{ github.workspace }}/docs/RISC-V-N-Trace.pdf
retention-days: 7
104 changes: 61 additions & 43 deletions .github/workflows/build-pdf.yml
Original file line number Diff line number Diff line change
@@ -1,61 +1,79 @@
# This workflow installs dependencies for PDF generation, generates the PDF,
# and uploads the PDF as an artifact.

name: Build ALL PDFs (listed below)
name: Build All PDFs

# The workflow is triggered by pull request, push to main, and manual dispatch.
on:
push:
branches:
- main
workflow_dispatch:
inputs:
prerelease:
description: 'Tag as a pre-release?'
required: false
type: boolean
default: true
draft:
description: 'Create release as a draft?'
required: false
type: boolean
default: false
pull_request:
push:
branches:
- master
- main
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest

env:
APT_PACKAGES_FILE: ${{ github.workspace }}/dependencies/apt_packages.txt
BUNDLE_GEMFILE: ${{ github.workspace }}/dependencies/Gemfile
BUNDLE_BIN: ${{ github.workspace }}/bin
NPM_PACKAGE_FOLDER: ${{ github.workspace }}/dependencies
steps:
# Step 1: Checkout the repository
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: 'true'
- name: Install Ubuntu packages
run: |
sudo apt-get update
grep -vE '^#' ${APT_PACKAGES_FILE} | xargs sudo apt-get install --yes --no-install-recommends
# Ruby for asciidoctor
- name: Setup Ruby and Gemfile content
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.2.0"
bundler-cache: true
# Node.js for wavedrom
- uses: actions/cache@v3
submodules: 'recursive'

# Step 2: Pull the latest RISC-V Docs container image
- name: Pull Container
run: docker pull riscvintl/riscv-docs-base-container-image:latest

# Step 3: Build Files
- name: Build Files
run: cd ./docs && make

# Step 4: Upload the built PDF files as independent artifacts
- name: Upload RISC-V-Trace-Control-Interface PDF
uses: actions/upload-artifact@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Setup Node.js
uses: actions/setup-node@v3
name: RISC-V-Trace-Control-Interface
path: ${{ github.workspace }}/docs/RISC-V-Trace-Control-Interface.pdf
retention-days: 30

- name: Upload RISC-V-Trace-Connectors PDF
uses: actions/upload-artifact@v3
with:
node-version: '16'
- name: Install Node.js dependencies
run: npm install ${NPM_PACKAGE_FOLDER}
- name: Generate PDF
run: |
PATH=${PATH}:${BUNDLE_BIN}:$(npm bin):$(pwd) \
make -C docs/ all
- name: Archive PDF result
name: RISC-V-Trace-Connectors
path: ${{ github.workspace }}/docs/RISC-V-Trace-Connectors.pdf
retention-days: 30

- name: Upload RISC-V-N-Trace PDF
uses: actions/upload-artifact@v3
with:
name: AllPDFs.zip
path: docs/*.pdf
retention-days: 21
name: RISC-V-N-Trace
path: ${{ github.workspace }}/docs/RISC-V-N-Trace.pdf
retention-days: 30

- name: Get short SHA
id: short-sha
run: echo "SHORT_SHA=$(git rev-parse --short=4 HEAD)" >> $GITHUB_ENV

# Step 5:Create Release
- name: Create Release
uses: softprops/action-gh-release@v1
with:
files: ${{ github.workspace }}/docs/*.pdf
tag_name: v${{ env.SHORT_SHA }}
name: Release ${{ env.SHORT_SHA }}
draft: ${{ github.event.inputs.draft }}
prerelease: ${{ github.event.inputs.prerelease }}
env:
GITHUB_TOKEN: ${{ secrets.GHTOKEN }}
if: github.event_name == 'workflow_dispatch'
14 changes: 0 additions & 14 deletions dependencies/Gemfile

This file was deleted.

3 changes: 0 additions & 3 deletions dependencies/README.md

This file was deleted.

Loading

0 comments on commit 1edd16b

Please sign in to comment.