forked from alire-project/alire-index
-
Notifications
You must be signed in to change notification settings - Fork 0
106 lines (92 loc) · 3.15 KB
/
build-crate.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
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
name: Build Crate
on:
pull_request:
paths:
- 'index/**.toml'
jobs:
build:
name: ${{ matrix.os }}::${{ matrix.tag }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- macos-latest
- ubuntu-latest
- windows-latest
tag:
- arch-rolling
- centos-latest-community-latest
- community-latest
- debian-stable
- ubuntu-lts
- ""
exclude: # inclusions don't allow to add arrays of values to a scenario
- os: ubuntu-latest
tag: ""
- os: macos-latest
tag: arch-rolling
- os: macos-latest
tag: centos-latest-community-latest
- os: macos-latest
tag: community-latest
- os: macos-latest
tag: debian-stable
- os: macos-latest
tag: ubuntu-lts
- os: windows-latest
tag: arch-rolling
- os: windows-latest
tag: centos-latest-community-latest
- os: windows-latest
tag: community-latest
- os: windows-latest
tag: debian-stable
- os: windows-latest
tag: ubuntu-lts
steps:
- name: Check out alire-index
uses: actions/checkout@v2
with:
fetch-depth: 0
# Needed to be able to diff and obtain changed files. Furthermore, we
# need the full history or else grafted partial branches confuse the
# changed files detectors (in both scripts/gh-build-crate.sh and
# check-author action).
- name: Update system repositories
if: matrix.os == 'ubuntu-latest'
run: sudo apt update
- name: Set up GNAT toolchain (FSF)
if: matrix.os == 'ubuntu-latest'
uses: ada-actions/toolchain@ce2021
with:
distrib: fsf # faster install?
- name: Set up GNAT toolchain (Community)
if: matrix.os != 'ubuntu-latest'
uses: ada-actions/toolchain@ce2020
with:
distrib: community
- name: Set up stable `alr`
if: contains(github.base_ref, 'stable-')
uses: alire-project/setup-alire@v1
with:
toolchain: --disable-assistant # We want to use the external ones in this workflow
- name: Set up devel `alr`
if: contains(github.base_ref, 'devel-')
uses: alire-project/setup-alire@v1
with:
toolchain: --disable-assistant # We want to use the external ones in this workflow
branch: master
- name: Test crate (Linux)
if: matrix.os == 'ubuntu-latest' # docker testing only for linuxes
uses: mosteo/actions@docker-run/v1
with:
image: alire/gnat:${{matrix.tag}}
command: scripts/gh-build-crate.sh
params: -v ${{ github.workspace }}/alire_install/bin/alr:/usr/bin/alr
- name: Install tar from msys2 (Windows) # Git tar in Actions VM does not seem to work)
if: matrix.os == 'windows-latest'
run: C:\Users\runneradmin\.cache\alire\msys64\usr\bin\pacman --noconfirm -S tar
- name: Test crate (Windows/MacOS)
if: matrix.os != 'ubuntu-latest' # native testing in Windows/MacOS
run: scripts/gh-build-crate.sh
shell: bash