-
Notifications
You must be signed in to change notification settings - Fork 19
126 lines (108 loc) · 4.19 KB
/
Copy pathci.yml
File metadata and controls
126 lines (108 loc) · 4.19 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
name: CI
on:
push:
branches: [ main, master ]
pull_request:
branches: [ "**" ]
workflow_dispatch:
concurrency:
group: ci
cancel-in-progress: false
permissions:
contents: read
packages: write
jobs:
build-ubuntu-1604:
name: Build and test on Ubuntu 16.04
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Build
uses: docker/bake-action@v7
with:
files: docker-bake.hcl
targets: |
extract-integration-test-build-artifact
extract-pre-bash-4-4-integration-test-build-artifact
lib-tests
set: |
extract-integration-test-build-artifact.output=type=local,dest=${{ runner.temp }}/docker/build
extract-pre-bash-4-4-integration-test-build-artifact.output=type=local,dest=${{ runner.temp }}/docker/build-pre-bash-4-4
*.cache-from=type=gha
*.cache-to=type=gha,mode=max
- name: Save built library artifact
uses: actions/upload-artifact@v7
with:
name: built-flyline-library
path: ${{ runner.temp }}/docker/build/libflyline.so
bash-integration-tests:
name: Bash integration tests using built library
runs-on: ubuntu-latest
needs:
- build-ubuntu-1604
strategy:
fail-fast: false
matrix:
bash_version_slug: [ "4_4-rc1", "4_4_18", "5_0", "5_3" ]
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Login to GHCR
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set lower case owner name
run: |
echo "OWNER_LC=${OWNER,,}" >>${GITHUB_ENV}
env:
OWNER: '${{ github.repository_owner }}'
- name: Run integration tests
uses: docker/bake-action@v7
with:
files: docker-bake.hcl
targets: bash-integration-test-${{ matrix.bash_version_slug }}
set: |
specific-bash-version-${{ matrix.bash_version_slug }}.cache-from=type=registry,ref=ghcr.io/${{ env.OWNER_LC }}/bash-${{ matrix.bash_version_slug }}:cache
specific-bash-version-${{ matrix.bash_version_slug }}.cache-to=type=registry,ref=ghcr.io/${{ env.OWNER_LC }}/bash-${{ matrix.bash_version_slug }}:cache,mode=min
bash-integration-test-${{ matrix.bash_version_slug }}.cache-from=type=gha
bash-integration-test-${{ matrix.bash_version_slug }}.cache-to=type=gha,mode=max
built-artifact.cache-from=type=gha
built-artifact.cache-to=type=gha,mode=max
bash-integration-tests-pre-4-4:
name: Bash integration tests (pre-4.4) using built library
runs-on: ubuntu-latest
needs:
- build-ubuntu-1604
strategy:
fail-fast: false
matrix:
bash_version_slug: [ "3_2_57" ]
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Login to GHCR
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set lower case owner name
run: |
echo "OWNER_LC=${OWNER,,}" >>${GITHUB_ENV}
env:
OWNER: '${{ github.repository_owner }}'
- name: Run integration tests
uses: docker/bake-action@v7
with:
files: docker-bake.hcl
targets: bash-integration-test-${{ matrix.bash_version_slug }}
set: |
specific-bash-version-${{ matrix.bash_version_slug }}.cache-from=type=registry,ref=ghcr.io/${{ env.OWNER_LC }}/bash-${{ matrix.bash_version_slug }}:cache
specific-bash-version-${{ matrix.bash_version_slug }}.cache-to=type=registry,ref=ghcr.io/${{ env.OWNER_LC }}/bash-${{ matrix.bash_version_slug }}:cache,mode=min
bash-integration-test-${{ matrix.bash_version_slug }}.cache-from=type=gha
bash-integration-test-${{ matrix.bash_version_slug }}.cache-to=type=gha,mode=max
built-artifact.cache-from=type=gha
built-artifact.cache-to=type=gha,mode=max