add dependency installation #5
Workflow file for this run
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: Build and Go Test | |
on: [push, pull_request] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '1.21.1' | |
cache: true | |
- name: Install can-utils | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y can-utils | |
sudo apt-get install -y linux-modules-extra-$(uname -r) | |
# vcan needs linux-modules-extra: https://github.com/linux-can/can-utils/issues/46 | |
- name: Setup vcan0 | |
run: | | |
sudo modprobe can | |
sudo modprobe can_raw | |
sudo modprobe vcan | |
sudo ip link add dev vcan0 type vcan | |
sudo ip link set up vcan0 | |
- name: Install dependencies | |
run: go get . | |
- name: Build go project | |
run: go build -v ./... | |
- name: Run go test | |
run: go test |