forked from tc39/ecma262
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Meta: migrate from travis-ci to Github Actions (tc39#2260)
- Loading branch information
Showing
7 changed files
with
129 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: 'ecma-262' | ||
|
||
on: [pull_request, push] | ||
|
||
jobs: | ||
build: | ||
name: 'build & lint ecmarkup' | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: ljharb/actions/node/install@56f291b2a0d9e3bce72634356ae949b1e054b9f8 | ||
name: 'nvm install lts/* && npm ci' | ||
with: | ||
node-version: lts/* | ||
use-npm-ci: true | ||
- run: npm run build-master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: 'ecma-262' | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
deploy: | ||
name: 'deploy github pages' | ||
runs-on: ubuntu-latest | ||
if: ${{ github.repository == 'tc39/ecma262' }} | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: ljharb/actions/node/install@56f291b2a0d9e3bce72634356ae949b1e054b9f8 | ||
name: 'nvm install lts/* && npm ci' | ||
with: | ||
node-version: lts/* | ||
use-npm-ci: true | ||
- run: npm run build-only | ||
- run: ./scripts/auto-deploy.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: Build Preview | ||
|
||
on: | ||
pull_request: | ||
|
||
jobs: | ||
build: | ||
name: 'build PR preview' | ||
runs-on: ubuntu-latest | ||
outputs: | ||
sha: ${{ github.event.pull_request.head.sha }} | ||
pr: ${{ github.event.number }} | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: ljharb/actions/node/install@56f291b2a0d9e3bce72634356ae949b1e054b9f8 | ||
name: 'nvm install lts/* && npm ci' | ||
with: | ||
node-version: lts/* | ||
use-npm-ci: true | ||
- run: npm run build-only | ||
- run: node scripts/insert_snapshot_warning | ||
- uses: actions/upload-artifact@v2 | ||
with: | ||
name: out | ||
path: out/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: Upload Preview | ||
|
||
on: | ||
workflow_run: | ||
workflows: ["Build Preview"] | ||
types: | ||
- completed | ||
|
||
jobs: | ||
upload: | ||
name: 'upload PR preview' | ||
runs-on: ubuntu-latest | ||
if: > | ||
${{ | ||
github.event.workflow_run.event == 'pull_request' && | ||
github.event.workflow_run.conclusion == 'success' && | ||
github.repository == 'tc39/ecma262' | ||
}} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: ljharb/actions/node/install@56f291b2a0d9e3bce72634356ae949b1e054b9f8 | ||
name: 'nvm install lts/* && npm ci' | ||
with: | ||
node-version: lts/* | ||
use-npm-ci: true | ||
- name: 'Download artifact' | ||
uses: actions/github-script@v3.1.0 | ||
with: | ||
script: | | ||
const { owner, repo } = context.repo; | ||
const artifacts = await github.actions.listWorkflowRunArtifacts({ | ||
owner, | ||
repo, | ||
run_id: ${{ github.event.workflow_run.id }}, | ||
}); | ||
const { id: artifact_id } = artifacts.data.artifacts.find((artifact) => artifact.name == 'out'); | ||
const download = await github.actions.downloadArtifact({ | ||
owner, | ||
repo, | ||
artifact_id, | ||
archive_format: 'zip', | ||
}); | ||
const fs = require('fs'); | ||
fs.writeFileSync('${{ github.workspace }}/out.zip', Buffer.from(download.data)); | ||
- run: unzip -o out.zip -d out | ||
- run: node scripts/publish-preview | ||
env: | ||
CI_PREVIEW_TOKEN: ${{ secrets.CI_PREVIEW_TOKEN }} | ||
PULL_REQUEST: ${{ github.event.workflow_run.pull_requests['0'].number }} | ||
GITHUB_HEAD_SHA: ${{ github.event.workflow_run.head_commit.id }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,5 +10,3 @@ jobs: | |
|
||
steps: | ||
- uses: ljharb/require-allow-edits@main | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters