-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (32 loc) · 1.28 KB
/
test.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
---
name: test
'on':
pull_request:
branches:
- main
schedule:
- cron: '0 6 * * *'
jobs:
makepkg:
name: makepkg
runs-on: ubuntu-latest
steps:
- name: Check out codebase.
uses: actions/checkout@v2
- name: Pull devel image
run: docker pull quay.io/aminvakil/archlinux:devel
- name: Run a container of devel image and mount package on it.
run: |
container_id=$(mktemp)
docker run --detach --privileged -v /sys/fs/cgroup:/sys/fs/cgroup:ro -v "${PWD}":/pkg quay.io/aminvakil/archlinux:devel > "${container_id}"
echo "container_id=$container_id" >> $GITHUB_ENV
- name: Execute stuff before makepkg if there is any.
run: if [ -f ci/before_makepkg.sh ]; then docker exec -i "$(cat ${container_id})" sh < ci/before_makepkg.sh; fi
- name: Upgrade all packages.
run: docker exec "$(cat ${container_id})" pacman -Suy --noconfirm
- name: Change ownership of package folder
run: "docker exec $(cat ${container_id}) chown -R devel: /pkg"
- name: Makepkg!
run: docker exec "$(cat ${container_id})" su devel sh -c "cd /pkg && makepkg -sri --noconfirm"
- name: Stop and remove container forcefully.
run: docker rm -f "$(cat ${container_id})"