Skip to content

Commit

Permalink
🏗 Matrixify amp build | dist checks on GH actions (ampproject#35731)
Browse files Browse the repository at this point in the history
  • Loading branch information
rsimha authored Aug 18, 2021
1 parent 057bae7 commit 2254561
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/cross-platform-builds.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
name: Cross-Platform Builds

on:
push:
branches:
- main

jobs:
build:
compile:
if: github.repository == 'ampproject/amphtml'
strategy:
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.platform }}
platform: [ubuntu, macos, windows]
flavor: [Build, Dist]
runs-on: ${{ matrix.platform }}-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install Dependencies
run: bash ./.github/workflows/install_dependencies.sh
- name: Build
run: node build-system/pr-check/cross-platform-builds.js
- name: ${{ matrix.flavor }}
run: node build-system/pr-check/cross-platform-builds.js --flavor=${{ matrix.flavor }}
4 changes: 2 additions & 2 deletions build-system/pr-check/cross-platform-builds.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
* @fileoverview Script that builds every commit on Linux, macOS, and Windows.
*/

const {flavor} = require('minimist')(process.argv.slice(2));
const {runCiJob} = require('./ci-job');
const {timedExecOrDie} = require('./utils');

Expand All @@ -28,8 +29,7 @@ const jobName = 'cross-platform-builds.js';
* Steps to run during push builds.
*/
function pushBuildWorkflow() {
timedExecOrDie('amp build');
timedExecOrDie('amp dist');
timedExecOrDie(flavor == 'Build' ? 'amp build' : 'amp dist');
}

runCiJob(jobName, pushBuildWorkflow, () => {});

0 comments on commit 2254561

Please sign in to comment.