Skip to content

Bump chisel3 from d752cae to 1dcac6a (#435) #767

Bump chisel3 from d752cae to 1dcac6a (#435)

Bump chisel3 from d752cae to 1dcac6a (#435) #767

Workflow file for this run

name: Continuous Integration
on:
pull_request:
branches: [master]
push:
branches: [master]
jobs:
api-docs:
name: API Docs
runs-on: ubuntu-latest
strategy:
matrix:
project: [chisel3]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Scala
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: '8'
cache: 'sbt'
- name: Calculate API Docs Cache Key
id: calc-key
run: |
KEY=$(make --always-make --dry-run apis-${{ matrix.project }} | sha256sum | awk '{print $1}')
echo "::set-output name=cache_key::${KEY}"
- name: Cache API Docs
uses: actions/cache@v3
with:
path: build/api/${{ matrix.project }}
key: ${{ runner.os }}-${{ matrix.project }}-${{ steps.calc-key.outputs.cache_key }}
# On miss, still start from previous value for incremental rebuild
restore-keys: |
${{ runner.os }}-${{ matrix.project }}
- name: ${{ matrix.project }} APIs
run: make apis-${{ matrix.project }}
- name: Tar build artifacts
run: tar zcf build/api/${{ matrix.project }}.tar.gz build/api/${{ matrix.project }}
- name: Share API Docs
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.project }}-api-docs
path: build/api/${{ matrix.project }}.tar.gz
website:
name: Build & Deploy Website
needs: [api-docs]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Scala
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: '8'
cache: 'sbt'
- name: Install CIRCT
uses: ./.github/workflows/install-circt
- name: Setup Ruby
uses: actions/setup-ruby@v1
- name: Setup Jekyll
run: |
gem install jekyll -v 4.2.0
gem install jekyll-redirect-from
- name: Download all built API docs
uses: actions/download-artifact@v3
with:
path: artifacts
- name: Untar build artifacts
run: for f in $(find artifacts -name "*.tar.gz"); do tar zxf "$f"; done
- name: Fetch submodules
run: git submodule update --init --recursive
- name: Build the microsite
run: make
- name: Deploy to GitHub Pages
if: github.event_name == 'push'
uses: JamesIves/[email protected]
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages
FOLDER: docs/target/site
# Sentinel job to simplify how we specify which checks need to pass in branch
# protection. This job checks that all jobs were successful.
#
# When adding new jobs, please add them to `needs` below
check-tests:
name: "check tests"
needs: [api-docs, website]
runs-on: ubuntu-20.04
if: success() # only run if all tests have passed
outputs:
success: ${{ steps.setoutput.outputs.success }}
steps:
- id: setoutput
run: echo "success=true" >> $GITHUB_OUTPUT
# Related to check-tests above, this job _always_ runs (even if tests fail
# and thus check-steps is skipped). This two sentinel job approach avoids an
# issue where failing tests causes a single sentinel job to be skipped which
# counts as passing for purposes of branch protection.
#
# See: https://brunoscheufler.com/blog/2022-04-09-the-required-github-status-check-that-wasnt
all_tests_passed:
name: "all tests passed"
runs-on: ubuntu-20.04
if: always() # Always run so that we never skip this check
needs: check-tests
# Pass only if check-tests set its output value
steps:
- run: |
PASSED="${{ needs.check-tests.outputs.success }}"
if [[ $PASSED == "true" ]]; then
echo "### All tests passed! :rocket:" >> $GITHUB_STEP_SUMMARY
exit 0
else
echo "### One or more tests FAILED! :bangbang:" >> $GITHUB_STEP_SUMMARY
exit 1
fi