-
Notifications
You must be signed in to change notification settings - Fork 1.4k
65 lines (52 loc) · 1.39 KB
/
ci.docker.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
name: ci·docker
on:
pull_request:
paths:
- .github/Dockerfile
- .github/workflows/ci.docker.yml
concurrency:
group: ci/docker/${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
packages: write
jobs:
docker-build:
runs-on: ubuntu-latest
container: debian:buster-slim
steps:
- uses: actions/checkout@v4
- run: apt-get update && apt-get install -y curl gcc
- uses: dtolnay/rust-toolchain@stable
- run: cargo build
- uses: actions/upload-artifact@v4
with:
name: products
path: ./target/debug/pkgx
docker-test:
runs-on: ubuntu-latest
needs: docker-build
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: products
- run: |
mkdir products
mv ./target/debug/pkgx products/$(uname -m)
curl https://pkgxdev.github.io/pkgm/pkgm.ts -o products/pkgm
- run:
docker build
--tag pkgxdev/pkgx
--file .github/Dockerfile
.
- run: |
cat <<EoD> Dockerfile
FROM pkgxdev/pkgx
RUN pkgx --version
RUN if git --version; then exit 1; fi
RUN pkgx git --version
RUN pkgm install git
RUN if ! git --version; then exit 2; fi
EoD
docker build --file Dockerfile .