Skip to content

Commit

Permalink
Simplify Github Actions CI (#75)
Browse files Browse the repository at this point in the history
  • Loading branch information
jackkoenig authored Dec 1, 2020
1 parent 50f4a0e commit 4b5f5ae
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 205 deletions.
66 changes: 0 additions & 66 deletions .github/scripts/ExtractBuildDependenciesFromPullRequest.gawk

This file was deleted.

29 changes: 0 additions & 29 deletions .github/scripts/generateGitClones.gawk

This file was deleted.

21 changes: 0 additions & 21 deletions .github/scripts/generateVersionOverrides.gawk

This file was deleted.

96 changes: 7 additions & 89 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,97 +10,15 @@ jobs:
image: ucbbar/chisel3-tools
options: --user github --entrypoint /bin/bash
env:
CHISEL3_REF: master
FIRRTL_REF: master
FIRRTL_INTERPRETER_REF: master
TREADLE_REF: master
CONTAINER_HOME: /home/github

steps:
- name: id
id: id
run: |
uid=$(id -u)
echo ::set-env name=CONTAINER_HOME::$(if [ "$uid" = "0" ]; then echo "/root"; else echo "/home/github"; fi)
printenv
whoami
git --version
pwd
# Currently, sbt seems to either ignore (or doesn't see) $HOME inside the container,
# and insists on using /home/<user> (i.e., /home/github).
# Set up symbolic links so /home/gitsub/.{sbt,cache} (inside the container) are links to
# the equivalent directories in $HOME (i.e, /github/home)
- name: link-caches
id: link-caches
run: |
echo "Link $CONTAINER_HOME caches to $HOME"
echo mkdir -p $HOME/.cache $HOME/.ivy2 $HOME/.sbt
mkdir -p $HOME/.cache $HOME/.ivy2 $HOME/.sbt
echo ln -s $HOME/.cache $HOME/.ivy2 $HOME/.sbt $CONTAINER_HOME
ln -s $HOME/.cache $HOME/.ivy2 $HOME/.sbt $CONTAINER_HOME
echo ls -la $HOME . $CONTAINER_HOME
ls -la $HOME . $CONTAINER_HOME
- name: checkout
- name: Checkout
uses: actions/checkout@v2
with:
path: repo
- name: cache-sbt
uses: actions/cache@v1
env:
cache-name: cache-sbt
with:
path: ~/.sbt
key: build-${{ env.cache-name }}-v1
restore-keys: |
build-${{ env.cache-name }}-
- name: cache-coursier
uses: actions/cache@v1
env:
cache-name: cache-coursier
with:
path: ~/.cache
key: build-${{ env.cache-name }}-v1
restore-keys: |
build-${{ env.cache-name }}-
- name: list
id: list
run: |
echo ls -la . repo ~/.sbt ~/.cache /home/github /home/github/.??*
ls -la . repo ~/.sbt ~/.cache /home/github /home/github/.??*
- name: env
id: env
run: |
echo "cat $GITHUB_EVENT_PATH"
cat $GITHUB_EVENT_PATH
- name: gawk
id: gawk
run: |
gawk -f repo/.github/scripts/ExtractBuildDependenciesFromPullRequest.gawk $GITHUB_EVENT_PATH > deps
ls -l deps
cat deps
gawk -f repo/.github/scripts/generateGitClones.gawk deps > clones.sh 3> shas.sh
cat shas.sh
bash shas.sh > shas
- name: cache-dependencies
id: cache-dependencies
uses: actions/cache@v1
env:
cache-name: cache-dependencies
with:
path: ~/.ivy2/local
key: build-${{ env.cache-name }}-v1-${{ hashFiles('shas') }}
- name: clone-deps
id: clone-deps
run: |
cat clones.sh
bash clones.sh
if: steps.cache-dependencies.outputs.cache-hit != 'true'
- name: version-deps
id: version-deps
run: |
versionDeps=$(gawk -f repo/.github/scripts/generateVersionOverrides.gawk deps)
echo "versonDeps: $versionDeps"
- name: test
- name: Setup Scala
uses: olafurpg/setup-scala@v10
- name: Cache
uses: coursier/cache-action@v5
- name: Test
id: test
run: cat /dev/null | sbt $versionDeps +test
working-directory: ./repo
run: sbt +test

0 comments on commit 4b5f5ae

Please sign in to comment.