-
Notifications
You must be signed in to change notification settings - Fork 3
69 lines (64 loc) · 2.55 KB
/
readme-test.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
# The readme-test workflow runs all commands contained in the README files of the apps.
name: readme-test
on:
workflow_dispatch:
pull_request:
types: [opened, ready_for_review]
jobs:
readme-test:
runs-on: ubuntu-latest
steps:
# Checks out the changes.
- name: git clone
uses: actions/checkout@v4
with:
lfs: true
# Make sure the commands remain unchanged.
- name: Check for changes in README file commands
run: |
python .nextmv/readme/readme-extract-commands.py
# Determine main language versions we support.
- name: set python and go versions
run: |
export GO_VERSION=$(yq '.language-support.go.version' workflow-configuration.yml)
echo "This is the Go version => $GO_VERSION"
echo "GO_VERSION=${GO_VERSION}" >> $GITHUB_ENV
export PYTHON_VERSION=$(yq '.language-support.python.version' workflow-configuration.yml)
echo "This is the Python version => $PYTHON_VERSION"
echo "PYTHON_VERSION=${PYTHON_VERSION}" >> $GITHUB_ENV
export JAVA_VERSION=$(yq '.language-support.java.version' workflow-configuration.yml)
echo "This is the Java version => $JAVA_VERSION"
echo "JAVA_VERSION=${JAVA_VERSION}" >> $GITHUB_ENV
export JAVA_DISTRIBUTION=$(yq '.language-support.java.distribution' workflow-configuration.yml)
echo "This is the Java distribution => $JAVA_DISTRIBUTION"
echo "JAVA_DISTRIBUTION=${JAVA_DISTRIBUTION}" >> $GITHUB_ENV
working-directory: .nextmv/
# Set up Go, Python, and Java according to previously determined versions.
- name: set up go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache-dependency-path: "**/*.sum"
- name: set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: "pip"
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: ${{ env.JAVA_DISTRIBUTION }}
java-version: ${{ env.JAVA_VERSION }}
cache: "maven"
# Install further custom dependencies for some apps.
- name: Install custom dependencies
run: |
sudo apt-get update
echo "Installing pyomo dependencies"
sudo apt-get install -y coinor-cbc coinor-libcbc-dev
sudo apt-get install -y glpk-utils
# Run tests.
- name: Run tests
run: |
go test -v ./...
working-directory: .nextmv/readme