-
Notifications
You must be signed in to change notification settings - Fork 0
107 lines (91 loc) · 2.35 KB
/
test-and-release.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
107
name: test-and-release
on:
push:
branches:
- main
workflow_dispatch:
pull_request:
permissions: read-all
jobs:
docker-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: docker-build
run: "make docker-build"
test-action-with-input-file:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Alway 0 to be sure to fetch all your files
- name: Run envsubst
uses: ./
with:
working-directory: "tests"
input-file: "input.txt"
output-file: "output.txt"
env:
FOO: "world"
- name: display output
run: cat ./tests/output.txt
- name: test-file-content
run: '[[ "$(cat ./tests/output.txt)" = "Hello world" ]]'
test-action-with-input-pattern:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Alway 0 to be sure to fetch all your files
- name: Run envsubst
uses: ./
with:
working-directory: "tests"
input-file-pattern: "*.txt"
output-file-suffix: ".out"
env:
FOO: "world"
- name: display output
run: |
pwd
ls -l
ls -l tests
cat ./tests/input.txt.out
- name: test-file-content
run: '[[ "$(cat ./tests/input.txt.out)" = "Hello world" ]]'
test-entrypoint-script:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: test-entrypoint
working-directory: tests
run: "make tests"
release:
runs-on: ubuntu-latest
concurrency:
group: release-${{ github.ref }}-${{ github.event_name }}
permissions:
contents: write
issues: write
id-token: write
packages: write
needs:
- docker-build
- test-action-with-input-file
- test-action-with-input-pattern
- test-entrypoint-script
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
- name: Release this GitHub Action
uses: rlespinasse/release-that@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}