forked from leoheck/kiri-docker
-
Notifications
You must be signed in to change notification settings - Fork 3
55 lines (52 loc) · 1.67 KB
/
test.yaml
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
name: Test Action
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
pull_request:
jobs:
test:
name: Build and Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Docker testing
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
driver: docker
- name: Log in to GHCR
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.PAT }}
- name: Build version
uses: docker/build-push-action@v4
with:
push: true
tags: ghcr.io/usa-reddragon/kiri-ci:${{ github.sha }}
- name: Modify action.yml to use local image
run: |
sed -i "s#ghcr.io/usa-reddragon/kiri:__KIRI_VERSION__#ghcr.io/usa-reddragon/kiri-ci:${{ github.sha }}#g" action.yml
# Action testing
- name: Clone SnekSafe for testing
uses: actions/checkout@v4
with:
repository: USA-RedDragon/SnekSafe
path: SnekSafe
- name: Test Local Action
uses: ./
with:
project-file: SnekSafe/kicad/sneksafe.kicad_pro
output-dir: SnekSafe/kicad/.kiri
- name: Ensure output directory was created
run: |
ls -l SnekSafe/kicad/.kiri
- name: Ensure output files were created
run: |
ls -l SnekSafe/kicad/.kiri/web/index.html
- name: Delete ci image from GHCR
if: always()
run: |
curl -X DELETE -H "Accept: application/vnd.github.v3+json" -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/USA-RedDragon/kiri-ci/packages/container/kiri-ci/versions/${{ github.sha }}