From e4a1c21749d42fcdf4c6ce89899d62a2501331ff Mon Sep 17 00:00:00 2001 From: Fabian Mastenbroek Date: Thu, 29 Oct 2020 14:04:28 +0100 Subject: Run all CI build pipelines on pull request --- .github/workflows/api.yml | 34 ------------------------------ .github/workflows/build-api.yml | 36 ++++++++++++++++++++++++++++++++ .github/workflows/build-frontend.yml | 31 ++++++++++++++++++++++++++++ .github/workflows/build-simulator.yml | 39 +++++++++++++++++++++++++++++++++++ .github/workflows/frontend.yml | 29 -------------------------- .github/workflows/simulator.yml | 37 --------------------------------- 6 files changed, 106 insertions(+), 100 deletions(-) delete mode 100644 .github/workflows/api.yml create mode 100644 .github/workflows/build-api.yml create mode 100644 .github/workflows/build-frontend.yml create mode 100644 .github/workflows/build-simulator.yml delete mode 100644 .github/workflows/frontend.yml delete mode 100644 .github/workflows/simulator.yml (limited to '.github') diff --git a/.github/workflows/api.yml b/.github/workflows/api.yml deleted file mode 100644 index ae67b753..00000000 --- a/.github/workflows/api.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: REST API - -on: - push: - paths: - - 'api/**' - -defaults: - run: - working-directory: 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 opendc diff --git a/.github/workflows/build-api.yml b/.github/workflows/build-api.yml new file mode 100644 index 00000000..5bbc30c4 --- /dev/null +++ b/.github/workflows/build-api.yml @@ -0,0 +1,36 @@ +name: Build API + +on: + push: + paths: + - 'api/**' + pull_request: + branches: [master] + +defaults: + run: + working-directory: 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 opendc diff --git a/.github/workflows/build-frontend.yml b/.github/workflows/build-frontend.yml new file mode 100644 index 00000000..67f356b9 --- /dev/null +++ b/.github/workflows/build-frontend.yml @@ -0,0 +1,31 @@ +name: Build Frontend + +on: + push: + paths: + - 'frontend/**' + pull_request: + branches: [master] + +defaults: + run: + working-directory: frontend + +jobs: + build: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest] + node: [12.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 new file mode 100644 index 00000000..8d9356b4 --- /dev/null +++ b/.github/workflows/build-simulator.yml @@ -0,0 +1,39 @@ +name: Build Simulator + +on: + push: + paths: + - 'simulator/**' + pull_request: + branches: [master] + +defaults: + run: + working-directory: simulator + +jobs: + build: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest] + java: [14] + steps: + - name: Checkout repository + uses: actions/checkout@v2 + - 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 }}-gradle-${{ hashFiles('**/*.gradle*') }} + restore-keys: | + ${{ runner.os }}-gradle- + - name: Build with Gradle + run: ./gradlew assemble + - name: Check with Gradle + run: ./gradlew check --info diff --git a/.github/workflows/frontend.yml b/.github/workflows/frontend.yml deleted file mode 100644 index da6f1031..00000000 --- a/.github/workflows/frontend.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: Frontend - -on: - push: - paths: - - 'frontend/**' - -defaults: - run: - working-directory: frontend - -jobs: - build: - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-latest] - node: [12.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/simulator.yml b/.github/workflows/simulator.yml deleted file mode 100644 index 8174ae3a..00000000 --- a/.github/workflows/simulator.yml +++ /dev/null @@ -1,37 +0,0 @@ -name: Simulator - -on: - push: - paths: - - 'simulator/**' - -defaults: - run: - working-directory: simulator - -jobs: - build: - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-latest] - java: [14] - steps: - - name: Checkout repository - uses: actions/checkout@v2 - - 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 }}-gradle-${{ hashFiles('**/*.gradle*') }} - restore-keys: | - ${{ runner.os }}-gradle- - - name: Build with Gradle - run: ./gradlew assemble - - name: Check with Gradle - run: ./gradlew check --info -- cgit v1.2.3 From 71fed6578389f021b13da8f6bc8f8ec9e85e363b Mon Sep 17 00:00:00 2001 From: Fabian Mastenbroek Date: Tue, 3 Nov 2020 19:37:28 +0100 Subject: Test Java 8 and Java 15 in CI pipeline This change updates the Github Actions workflow for the simulator to test both Java 8 and Java 15. --- .github/workflows/build-simulator.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to '.github') diff --git a/.github/workflows/build-simulator.yml b/.github/workflows/build-simulator.yml index 8d9356b4..57e8b46d 100644 --- a/.github/workflows/build-simulator.yml +++ b/.github/workflows/build-simulator.yml @@ -17,7 +17,7 @@ jobs: strategy: matrix: os: [ubuntu-latest] - java: [14] + java: [8, 15] steps: - name: Checkout repository uses: actions/checkout@v2 @@ -30,9 +30,9 @@ jobs: - uses: actions/cache@v1 with: path: ~/.gradle/caches - key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }} + key: ${{ runner.os }}-${{ matrix.java }}-gradle-${{ hashFiles('**/*.gradle*') }} restore-keys: | - ${{ runner.os }}-gradle- + ${{ runner.os }}-${{ matrix.java }}-gradle- - name: Build with Gradle run: ./gradlew assemble - name: Check with Gradle -- cgit v1.2.3 From e706cb9ef3e0c8b55746c24808ae90034bfacdd0 Mon Sep 17 00:00:00 2001 From: Fabian Mastenbroek Date: Tue, 3 Nov 2020 19:44:54 +0100 Subject: Test frontend using Node 14 in Github Actions --- .github/workflows/build-frontend.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '.github') diff --git a/.github/workflows/build-frontend.yml b/.github/workflows/build-frontend.yml index 67f356b9..73ab49d5 100644 --- a/.github/workflows/build-frontend.yml +++ b/.github/workflows/build-frontend.yml @@ -17,7 +17,7 @@ jobs: strategy: matrix: os: [ubuntu-latest] - node: [12.x] + node: [14.x] steps: - uses: actions/checkout@v2 - name: Set up Node.js -- cgit v1.2.3