forked from mkaczanowski/packer-builder-arm
-
Notifications
You must be signed in to change notification settings - Fork 1
73 lines (62 loc) · 1.9 KB
/
vagrant.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
name: Vagrant
on:
push:
branches:
- master
pull_request:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
test:
runs-on: ubuntu-latest
name: Build board with vagrant
steps:
- name: Check GitHub Status
uses: crazy-max/ghaction-github-status@v4
- uses: actions/checkout@v4
- name: Cache Vagrant boxes
uses: actions/cache@v4
with:
path: ~/.vagrant.d/boxes
key: ${{ runner.os }}-vagrant-${{ hashFiles('Vagrantfile') }}
restore-keys: |
${{ runner.os }}-vagrant-
- name: Install vagrant / virtualbox
run: |
sudo apt-get update
sudo apt-get install -y vagrant virtualbox
- name: Show Vagrant version
run: vagrant --version
- name: Install Vagrant plugins
run: |
vagrant plugin install vagrant-disksize
- name: Run vagrant up
run: |
for i in {1..4}; do
if vagrant up; then
break
fi
vagrant destroy -f
sleep $i
done
- name: Upload source
run: |
git archive -o repo.tar.gz HEAD
vagrant upload repo.tar.gz /home/vagrant/repo.tar.gz
vagrant ssh -c " \
rm -rf packer-plugin-cross && \
mkdir packer-plugin-cross && \
tar -xf repo.tar.gz -C packer-plugin-cross \
"
- name: Build board
run: |
vagrant ssh -c " \
cd packer-plugin-cross && \
sudo PACKER_LOG=1 packer init boards/raspberry-pi-3/archlinuxarm.pkr.hcl && \
sudo PACKER_LOG=1 packer build boards/raspberry-pi-3/archlinuxarm.pkr.hcl \
"
- name: Check result
run: |
vagrant ssh -c "ls -al packer-plugin-cross/raspberry-pi-3.img"