forked from hdl/conda-eda
-
Notifications
You must be signed in to change notification settings - Fork 0
97 lines (86 loc) · 2.71 KB
/
tuttest.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
name: tuttest
on:
pull_request:
paths:
- 'syn/symbiflow-yosys/*'
- '.github/workflows/tuttest.yml'
- 'docs/DEVELOPMENT.md'
push:
paths:
- 'syn/symbiflow-yosys/*'
- '.github/workflows/tuttest.yml'
- 'docs/DEVELOPMENT.md'
workflow_dispatch:
env:
ARTIFACT_NAME: tuttest-script
SCRIPT: tuttest-script.sh
jobs:
grab-readme-commands:
runs-on: ubuntu-latest
steps:
- name: Install tuttest
run: |
python3 -m pip install setuptools
python3 -m pip install git+https://github.com/antmicro/tuttest@5dbe5845c9ef46f1c0315129449743db010ff966
# On GitHub Actions, pip installs "binaries" to this directory
echo "/home/runner/.local/bin" >> $GITHUB_PATH
- name: Test tuttest
run: tuttest --help
- name: Checkout repository
uses: actions/checkout@v3
- name: Grab install-prerequisites commands with tuttest
run: |
echo "# docs/DEVELOPMENT.md/install-prerequisites" >$SCRIPT
echo >>$SCRIPT
# SED changes URL in case the CI is running on a fork
# and adds conda-eda as a directory name
tuttest docs/DEVELOPMENT.md install-prerequisites | sed -e "s#git clone .*\.git.*#git clone https://github.com/$GITHUB_REPOSITORY.git conda-eda#" >>$SCRIPT
echo >>$SCRIPT
- name: Add checkout commands
run: |
echo "# Checkout commands" >>$SCRIPT
echo >>$SCRIPT
_branch="$GITHUB_SHA"
if [ "${{ github.event_name }}" = "pull_request" ]; then
_branch="ci-pr-branch"
echo "git fetch origin $GITHUB_REF:${_branch}" >>$SCRIPT
fi
echo "git checkout ${_branch}" >>$SCRIPT
echo >>$SCRIPT
- name: Grab prepare-and-build commands with tuttest
run: |
echo "# docs/DEVELOPMENT.md/prepare-and-build" >>$SCRIPT
echo >>$SCRIPT
tuttest docs/DEVELOPMENT.md prepare-and-build >>$SCRIPT
- name: Print ${{ env.SCRIPT }}
run: cat $SCRIPT
- uses: actions/upload-artifact@v3
with:
name: ${{ env.ARTIFACT_NAME }}
path: ${{ env.SCRIPT }}
test-readme-commands:
needs: grab-readme-commands
runs-on: ubuntu-latest
container:
image: ${{ matrix.container-os }}
strategy:
fail-fast: false
matrix:
container-os:
- ubuntu:18.04
- ubuntu:20.04
- debian:8
- debian:9
- debian:10
defaults:
run:
shell: bash
steps:
- uses: actions/download-artifact@v3
with:
name: ${{ env.ARTIFACT_NAME }}
- name: Test
run: |
set -e
set -x
source $SCRIPT