summaryrefslogtreecommitdiff
path: root/.github
diff options
context:
space:
mode:
authorFabian Mastenbroek <mail.fabianm@gmail.com>2021-04-26 15:41:50 +0200
committerFabian Mastenbroek <mail.fabianm@gmail.com>2021-05-03 20:15:56 +0200
commit820bbd95ff4f1dd081610958257ac7938fbfd79f (patch)
tree0bdbadad0cd15b2e8c3f9ff3fd83a79b02301f36 /.github
parent0452e8e51279a7c56d052d00d33318e2697a2a44 (diff)
ci: Merge CI builds into single workflow
This change merges the three CI builds for the simulator, frontend and API into a single workflow that builds the components in separate, independent jobs.
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/build-api.yml45
-rw-r--r--.github/workflows/build-frontend.yml28
-rw-r--r--.github/workflows/build-simulator.yml56
-rw-r--r--.github/workflows/build.yml115
4 files changed, 115 insertions, 129 deletions
diff --git a/.github/workflows/build-api.yml b/.github/workflows/build-api.yml
deleted file mode 100644
index e863ba05..00000000
--- a/.github/workflows/build-api.yml
+++ /dev/null
@@ -1,45 +0,0 @@
-name: Build API
-
-on:
- pull_request:
- branches: [master]
-
-defaults:
- run:
- working-directory: opendc-web/opendc-web-api
-
-jobs:
- build:
- runs-on: ${{ matrix.os }}
- strategy:
- matrix:
- os: [ubuntu-latest]
- python: [3.8]
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v2
- with:
- python-version: ${{ matrix.python }}
- - name: Install dependencies
- run: |
- python -m pip install --upgrade pip
- pip install -r requirements.txt
- - name: Lint with pylint
- run: ./check.sh
- - name: Test with pytest
- run: pytest --cov=opendc/ --junitxml=.junit-report.xml
- - name: Publish report
- if: always()
- uses: mikepenz/action-junit-report@v2
- with:
- check_name: test (Python ${{ matrix.python }})
- report_paths: '**/.junit-report.xml'
- github_token: ${{ secrets.GITHUB_TOKEN }}
- - name: Upload code coverage
- uses: codecov/codecov-action@v1
- with:
- token: ${{ secrets.CODECOV_TOKEN }}
- files: opendc-web/opendc-web-api/.coverage
- flags: api
-
diff --git a/.github/workflows/build-frontend.yml b/.github/workflows/build-frontend.yml
deleted file mode 100644
index e00340ed..00000000
--- a/.github/workflows/build-frontend.yml
+++ /dev/null
@@ -1,28 +0,0 @@
-name: Build Frontend
-
-on:
- pull_request:
- branches: [master]
-
-defaults:
- run:
- working-directory: opendc-web/opendc-web-ui
-
-jobs:
- build:
- runs-on: ${{ matrix.os }}
- strategy:
- matrix:
- os: [ubuntu-latest]
- node: [14.x]
- steps:
- - uses: actions/checkout@v2
- - name: Set up Node.js
- uses: actions/setup-node@v1
- with:
- node-version: ${{ matrix.node }}
- - run: npm install
- - run: npm run build --if-present
- - run: npm test
- env:
- CI: true
diff --git a/.github/workflows/build-simulator.yml b/.github/workflows/build-simulator.yml
deleted file mode 100644
index ee8f95f2..00000000
--- a/.github/workflows/build-simulator.yml
+++ /dev/null
@@ -1,56 +0,0 @@
-name: Build Simulator
-
-on:
- pull_request:
- branches: [master]
-
-jobs:
- build:
- runs-on: ${{ matrix.os }}
- strategy:
- matrix:
- os: [ubuntu-latest]
- java: [8, 15]
- steps:
- - name: Checkout repository
- uses: actions/checkout@v2
- - name: Validate Gradle wrapper
- uses: gradle/wrapper-validation-action@v1
- - name: Set up JDK
- uses: actions/setup-java@v1
- with:
- java-version: ${{ matrix.java }}
- - name: Grant execute permission for gradlew
- run: chmod +x gradlew
- - uses: actions/cache@v1
- with:
- path: ~/.gradle/caches
- key: ${{ runner.os }}-${{ matrix.java }}-gradle-${{ hashFiles('**/*.gradle*') }}
- restore-keys: |
- ${{ runner.os }}-${{ matrix.java }}-gradle-
- - name: Build with Gradle
- run: ./gradlew assemble
- - name: Check with Gradle
- run: ./gradlew check codeCoverageReport
- - name: Publish report
- if: always()
- uses: mikepenz/action-junit-report@v2
- with:
- check_name: test (Java ${{ matrix.java }})
- report_paths: '**/build/test-results/test/TEST-*.xml'
- github_token: ${{ secrets.GITHUB_TOKEN }}
- - name: Upload artifacts
- if: always()
- uses: actions/upload-artifact@v2
- with:
- name: reports-${{ matrix.os }}-jdk${{ matrix.java }}
- path: |
- ./**/build/reports/**/*
- ./**/build/test-results/**/*
- retention-days: 5
- - name: Upload code coverage
- uses: codecov/codecov-action@v1
- with:
- token: ${{ secrets.CODECOV_TOKEN }}
- files: ./build/reports/jacoco/report.xml
- flags: simulator
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
new file mode 100644
index 00000000..cbf2f80d
--- /dev/null
+++ b/.github/workflows/build.yml
@@ -0,0 +1,115 @@
+name: Build
+
+on:
+ pull_request:
+ branches: [master]
+
+jobs:
+ build-simulator:
+ name: Build Simulator (Java ${{ matrix.java }})
+ runs-on: ${{ matrix.os }}
+ strategy:
+ matrix:
+ os: [ubuntu-latest]
+ java: [8, 15]
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v2
+ - name: Validate Gradle wrapper
+ uses: gradle/wrapper-validation-action@v1
+ - name: Set up JDK
+ uses: actions/setup-java@v1
+ with:
+ java-version: ${{ matrix.java }}
+ - name: Grant execute permission for gradlew
+ run: chmod +x gradlew
+ - uses: actions/cache@v1
+ with:
+ path: ~/.gradle/caches
+ key: ${{ runner.os }}-${{ matrix.java }}-gradle-${{ hashFiles('**/*.gradle*') }}
+ restore-keys: |
+ ${{ runner.os }}-${{ matrix.java }}-gradle-
+ - name: Build with Gradle
+ run: ./gradlew assemble
+ - name: Check with Gradle
+ run: ./gradlew check codeCoverageReport
+ - name: Publish report
+ if: always()
+ uses: mikepenz/action-junit-report@v2
+ with:
+ check_name: test (Java ${{ matrix.java }})
+ report_paths: '**/build/test-results/test/TEST-*.xml'
+ github_token: ${{ secrets.GITHUB_TOKEN }}
+ - name: Upload artifacts
+ if: always()
+ uses: actions/upload-artifact@v2
+ with:
+ name: reports-${{ matrix.os }}-jdk${{ matrix.java }}
+ path: |
+ ./**/build/reports/**/*
+ ./**/build/test-results/**/*
+ retention-days: 5
+ - name: Upload code coverage
+ uses: codecov/codecov-action@v1
+ with:
+ token: ${{ secrets.CODECOV_TOKEN }}
+ files: ./build/reports/jacoco/report.xml
+ flags: simulator
+ build-api:
+ name: Build API (Python ${{ matrix.python }})
+ runs-on: ${{ matrix.os }}
+ strategy:
+ matrix:
+ os: [ubuntu-latest]
+ python: [3.8]
+ defaults:
+ run:
+ working-directory: opendc-web/opendc-web-api
+ steps:
+ - uses: actions/checkout@v2
+ - name: Set up Python
+ uses: actions/setup-python@v2
+ with:
+ python-version: ${{ matrix.python }}
+ - name: Install dependencies
+ run: |
+ python -m pip install --upgrade pip
+ pip install -r requirements.txt
+ - name: Lint with pylint
+ run: ./check.sh
+ - name: Test with pytest
+ run: pytest --cov=opendc/ --junitxml=.junit-report.xml
+ - name: Publish report
+ if: always()
+ uses: mikepenz/action-junit-report@v2
+ with:
+ check_name: test (Python ${{ matrix.python }})
+ report_paths: '**/.junit-report.xml'
+ github_token: ${{ secrets.GITHUB_TOKEN }}
+ - name: Upload code coverage
+ uses: codecov/codecov-action@v1
+ with:
+ token: ${{ secrets.CODECOV_TOKEN }}
+ files: opendc-web/opendc-web-api/.coverage
+ flags: api
+ build-ui:
+ name: Build UI (Node ${{ matrix.node }})
+ runs-on: ${{ matrix.os }}
+ strategy:
+ matrix:
+ os: [ubuntu-latest]
+ node: [14.x]
+ defaults:
+ run:
+ working-directory: opendc-web/opendc-web-ui
+ steps:
+ - uses: actions/checkout@v2
+ - name: Set up Node.js
+ uses: actions/setup-node@v1
+ with:
+ node-version: ${{ matrix.node }}
+ - run: npm install
+ - run: npm run build --if-present
+ - run: npm test
+ env:
+ CI: true