Skip to content

Commit 12de8ff

Browse files
authored
feat: build generator in CI and store it in artifacts storage (#163)
I guess we can't really have test runs until it's merged, so I'm merging it.
1 parent 8891baa commit 12de8ff

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

.github/workflows/generator.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Dockerfile Generator
2+
on:
3+
push:
4+
paths:
5+
- generator
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-22.04
10+
steps:
11+
- uses: actions/checkout@v5.0.0
12+
- name: Cache .stack directory
13+
uses: actions/cache@v4.3.0
14+
with:
15+
path: ~/.stack
16+
key: ${{ runner.os }}-stack-${{ hashFiles('generator/stack.yaml.lock') }}
17+
18+
- name: Cache build artifacts
19+
uses: actions/cache@v4.3.0
20+
with:
21+
path: generator/.stack-work
22+
key: ${{ runner.os }}-stack-work-${{ hashFiles('generator/stack.yaml.lock', 'generator/generator.cabal') }}
23+
- name: Install Haskell toolchain and stack
24+
uses: haskell-actions/setup@v2.8.2
25+
with:
26+
enable-stack: true
27+
28+
- name: Set up Stack project
29+
working-directory: generator
30+
run: stack setup
31+
- name: Build generator
32+
working-directory: generator
33+
run: stack build --no-terminal
34+
- name: Run generator
35+
working-directory: generator
36+
run: stack exec generator -- --help
37+
38+
- name: Copy generator binary to artifacts
39+
working-directory: generator
40+
run: |
41+
mkdir -p ../artifacts
42+
stack --local-bin-path=../artifacts install
43+
- name: Upload generator artifact
44+
uses: actions/upload-artifact@v4.6.2
45+
with:
46+
name: dockerfile-generator
47+
path: artifacts/generator

0 commit comments

Comments
 (0)