Execute Listing #5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Execute Listing" | |
env: | |
GITHUB_USERNAME: ${{ github.actor }} | |
GITHUB_EMAIL: "${{ github.actor }}@users.noreply.github.com" | |
on: | |
workflow_dispatch: | |
inputs: | |
listing: | |
type: string | |
description: 'Listing number (e.g. 2.1)' | |
required: true | |
jobs: | |
execute-listing: | |
name: "Executing listing ${{ github.event.inputs.listing }}" | |
runs-on: ubuntu-latest | |
steps: | |
- id: go-cache-paths | |
run: | | |
echo "::set-output name=go-build::$(go env GOCACHE)" | |
echo "::set-output name=go-mod::$(go env GOMODCACHE)" | |
- uses: actions/checkout@v2 | |
- name: Install Go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: '1.20' | |
- name: Install Protoc Dependencies | |
run: | | |
sudo apt-get install -y protobuf-compiler golang-goprotobuf-dev | |
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest | |
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest | |
- name: Go Build Cache | |
uses: actions/cache@v2 | |
with: | |
path: ${{ steps.go-cache-paths.outputs.go-build }} | |
key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }} | |
- name: Run | |
run: | | |
cd "$(find . -name listing_${{ github.event.inputs.listing }})" | |
./run.sh ${{ env.GITHUB_USERNAME }} ${{ env.GITHUB_EMAIL }} |