Skip to content

Commit

Permalink
gha: checkout code as first step
Browse files Browse the repository at this point in the history
This commit moves the checkout to the beginning of all steps.
This way the go.mod file can be used to determine to Go version
to use in the setup-go Github Action.

Signed-off-by: Marco Hofstetter <[email protected]>
  • Loading branch information
mhofstetter committed Dec 6, 2023
1 parent 588c97c commit aad3db9
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/basic.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@ jobs:
matrix:
os: [ ubuntu-22.04 ]
steps:
- name: Install Go
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
go-version-file: "go.mod"

- name: Checkout code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
path: src/little-vm-helper

- name: Install Go
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
go-version-file: "go.mod"

- name: Build and run Go tests
run: |
cd src/little-vm-helper
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ jobs:
matrix:
os: [ ubuntu-22.04 ]
steps:
- name: Checkout code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
path: src/little-vm-helper

- name: Install Go
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
Expand All @@ -26,11 +31,6 @@ jobs:
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 648ACFD622F3D138 0E98404D386FA1D9
sudo apt-get -qy install mmdebstrap libguestfs-tools qemu-utils extlinux git fakeroot build-essential xz-utils libssl-dev bc flex libelf-dev bison pahole
- name: Checkout code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
path: src/little-vm-helper

- name: Make kernel accessible
run: |
sudo chmod go+rX -R /boot/
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/quay.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ jobs:
quay:
runs-on: ubuntu-22.04
steps:
- name: Install Go
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
go-version-file: "go.mod"

- name: Checkout code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0

- name: Install Go
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
go-version-file: "go.mod"

- uses: imjasonh/setup-ko@ace48d793556083a76f1e3e6068850c1f4a369aa # v0.6
env:
KO_DOCKER_REPO: quay.io/lvh-images/lvh
Expand Down

0 comments on commit aad3db9

Please sign in to comment.