-
Notifications
You must be signed in to change notification settings - Fork 12
53 lines (52 loc) · 1.36 KB
/
ci.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
name: Build and Test
on:
pull_request:
types: [opened, reopened, synchronize]
paths:
- Dockerfile
- Gemfile
- Gemfile.lock
- entrypoint.sh
- test/**
- .github/workflows/ci.yml
env:
REGISTRY: ghcr.io
IMAGE_NAME: heromo/pronto-action
jobs:
test:
name: Build and Test
runs-on: ubuntu-latest
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
timeout-minutes: 60
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Build Image
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
load: true
push: false
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
- name: Modify action.yaml
run: yq '.runs.image = "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest"' -i action.yaml
- name: Prepare Tests
run: |
cp -rf ./test ./test-tmp
git config --global user.email "[email protected]"
git config --global user.name "Tester"
git add -f ./test-tmp
git commit -m 'for test'
- name: Test Local Action
uses: ./
with:
runner: rubocop
path: ./test-tmp/
formatters: text