Skip to content

Commit

Permalink
chore(ci): add snapshot test
Browse files Browse the repository at this point in the history
  • Loading branch information
ChipWolf committed Nov 26, 2024
1 parent 143c5e5 commit 6976335
Showing 1 changed file with 80 additions and 0 deletions.
80 changes: 80 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
---
name: Snapshot Test

"on":
push:
branches:
- main

jobs:
setup-go-and-snapshot:
name: Setup Go and Create Snapshot
runs-on: warp-ubuntu-2204-x64-2x
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Download go.sum
run: |
set -x
wget --no-verbose https://raw.githubusercontent.com/packwiz/packwiz/refs/heads/main/go.sum
echo $PATH
- name: Setup Go
uses: WarpBuilds/setup-go@v5
with:
go-version: "1.23.3"

- name: Install and verify
run: |
set -x
go install github.com/packwiz/packwiz@latest
echo $PATH
packwiz
- name: Create snapshot
uses: WarpBuilds/snapshot-save@v1
with:
alias: "go-setup-${{ github.run_id }}"
fail-on-error: true
wait-timeout-minutes: 60

run-from-snapshot:
name: Verify Snapshot
runs-on: warp-ubuntu-2204-x64-2x;snapshot.key=go-setup-${{ github.run_id }}
needs: setup-go-and-snapshot
steps:
- name: Verify
run: |
set -x
echo $PATH
packwiz
run-from-snapshot-go:
name: Verify Snapshot with Go Setup
runs-on: warp-ubuntu-2204-x64-2x;snapshot.key=go-setup-${{ github.run_id }}
needs: setup-go-and-snapshot
steps:
- name: Setup Go
uses: WarpBuilds/setup-go@v5
with:
go-version: "1.23.3"

- name: Verify
run: |
set -x
echo $PATH
packwiz
run-from-snapshot-path:
name: Verify Snapshot with PATH
runs-on: warp-ubuntu-2204-x64-2x;snapshot.key=go-setup-${{ github.run_id }}
needs: setup-go-and-snapshot
steps:
- name: Set PATH and verify
run:
set -x
echo $PATH
export PATH="/home/runner/go/bin:/opt/hostedtoolcache/go/1.23.3/x64/bin:${PATH}"
echo $PATH
packwiz

0 comments on commit 6976335

Please # to comment.