-
Notifications
You must be signed in to change notification settings - Fork 11
148 lines (125 loc) · 4.65 KB
/
stage3check.yml
File metadata and controls
148 lines (125 loc) · 4.65 KB
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
name: Stage3 Check
on:
push:
paths:
- '.github/workflows/**.yml'
workflow_dispatch:
schedule:
- cron: '25 12 * * *'
jobs:
stage3-amd64:
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
arch: [amd64]
init: [openrc,systemd]
env:
STAGE3_ARCH: ${{ matrix.arch == 'arm64' && 'arm64' || 'amd64' }}
STAGE3_INIT: ${{ matrix.init == 'openrc' && 'openrc' || 'systemd' }}
steps:
- name: Run apt update
run: |
sudo apt update
- name: Install Dependencies
run: |
sudo apt install -y systemd-container qemu-user-static
- name: Check Remote Resources
run: |
wget https://bouncer.gentoo.org/fetch/root/all/releases/${STAGE3_ARCH}/autobuilds/latest-stage3-${STAGE3_ARCH}-${STAGE3_INIT}.txt -O - | awk '/-----BEGIN PGP SIGNATURE-----/{print x}{x=$0}' | tail -n 1 | tee latest-stage3.txt
git ls-remote https://github.com/gentoo-mirror/gentoo HEAD | tee gentoo-repo-head.txt
- name: Initialize Cache of Stage 3
uses: actions/cache@v2
id: stage3-cache
with:
path: stage3.tar.xz
key: ${{ matrix.arch }}-${{ matrix.init }}-${{ hashFiles('latest-stage3.txt') }}
- name: Deploy Latest Stage 3
run: |
if [ ! -f "stage3.tar.xz" ]
then
STAGE3=$(tail -n 1 latest-stage3.txt | cut -d ' ' -f 1)
wget https://bouncer.gentoo.org/fetch/root/all/releases/${STAGE3_ARCH}/autobuilds/${STAGE3} -O stage3.tar.xz
fi
mkdir chroot
pushd chroot
sudo tar -xaf ../stage3.tar.xz
- name: Initialize Cache of Gentoo Repository
uses: actions/cache@v2
id: gentoo-repo-cache
with:
path: gentoo-repo
key: gentoo-repo-${{ hashFiles('gentoo-repo-head.txt') }}
restore-keys: |
gentoo-repo
- name: Deploy Gentoo Repo
run: |
if [ -d "gentoo-repo" ]
then
sudo git -C gentoo-repo fetch --depth=10
sudo git -C gentoo-repo reset --hard origin/stable
sudo git -C gentoo-repo gc --prune=all
else
sudo git clone --depth=10 https://github.com/gentoo-mirror/gentoo gentoo-repo
fi
- name: Build
run: |
sudo systemd-nspawn --ephemeral --bind-ro=${PWD}/gentoo-repo:/var/db/repos/gentoo --directory=${PWD}/chroot/ /usr/bin/emerge --pretend -v --update --newuse @world
stage3-arm:
runs-on: ubuntu-24.04-arm
strategy:
fail-fast: false
matrix:
arch: [arm64]
init: [openrc,systemd]
env:
STAGE3_ARCH: ${{ matrix.arch == 'arm64' && 'arm64' || 'amd64' }}
STAGE3_INIT: ${{ matrix.init == 'openrc' && 'openrc' || 'systemd' }}
steps:
- name: Run apt update
run: |
sudo apt update
- name: Install Dependencies
run: |
sudo apt install -y systemd-container qemu-user-static
- name: Check Remote Resources
run: |
wget https://bouncer.gentoo.org/fetch/root/all/releases/${STAGE3_ARCH}/autobuilds/latest-stage3-${STAGE3_ARCH}-${STAGE3_INIT}.txt -O - | awk '/-----BEGIN PGP SIGNATURE-----/{print x}{x=$0}' | tail -n 1 | tee latest-stage3.txt
git ls-remote https://github.com/gentoo-mirror/gentoo HEAD | tee gentoo-repo-head.txt
- name: Initialize Cache of Stage 3
uses: actions/cache@v2
id: stage3-cache
with:
path: stage3.tar.xz
key: ${{ matrix.arch }}-${{ matrix.init }}-${{ hashFiles('latest-stage3.txt') }}
- name: Deploy Latest Stage 3
run: |
if [ ! -f "stage3.tar.xz" ]
then
STAGE3=$(tail -n 1 latest-stage3.txt | cut -d ' ' -f 1)
wget https://bouncer.gentoo.org/fetch/root/all/releases/${STAGE3_ARCH}/autobuilds/${STAGE3} -O stage3.tar.xz
fi
mkdir chroot
pushd chroot
sudo tar -xaf ../stage3.tar.xz
- name: Initialize Cache of Gentoo Repository
uses: actions/cache@v2
id: gentoo-repo-cache
with:
path: gentoo-repo
key: gentoo-repo-${{ hashFiles('gentoo-repo-head.txt') }}
restore-keys: |
gentoo-repo
- name: Deploy Gentoo Repo
run: |
if [ -d "gentoo-repo" ]
then
sudo git -C gentoo-repo fetch --depth=10
sudo git -C gentoo-repo reset --hard origin/stable
sudo git -C gentoo-repo gc --prune=all
else
sudo git clone --depth=10 https://github.com/gentoo-mirror/gentoo gentoo-repo
fi
- name: Build
run: |
sudo systemd-nspawn --ephemeral --bind-ro=${PWD}/gentoo-repo:/var/db/repos/gentoo --directory=${PWD}/chroot/ /usr/bin/emerge --pretend -v --update --newuse @world