Skip to content

Commit

Permalink
Update GitHub Actions workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
trheyi committed Dec 25, 2023
1 parent a64c3de commit 6dbb9c1
Show file tree
Hide file tree
Showing 4 changed files with 100 additions and 80 deletions.
30 changes: 17 additions & 13 deletions .github/workflows/leakcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,20 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: 1.17.2
- name: Checkout
uses: actions/checkout@v2
- name: Go Test
env:
CC: clang
CXX: clang++
run: |
go test -c --tags leakcheck
./v8go.test
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: 1.17.2

- name: Checkout
uses: actions/checkout@v4
with:
lfs: true

- name: Go Test
env:
CC: clang
CXX: clang++
run: |
go test -c --tags leakcheck
./v8go.test
62 changes: 34 additions & 28 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,31 +17,37 @@ jobs:
runs-on: ${{ matrix.platform }}

steps:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- name: Checkout
uses: actions/checkout@v2
- name: Go Test
env:
CGO_CXXFLAGS: "-Werror"
run: go test -v -coverprofile c.out ./...
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
env:
OS: ${{ matrix.platform }}
GO: ${{ matrix.go-version }}
with:
files: ./c.out
env_vars: OS,GO
- name: Add GOPATH to GITHUB_ENV
run: echo "GOPATH=$(go env GOPATH)" >>"$GITHUB_ENV"
- name: Scan and upload FOSSA data (Linux/Mac)
if: env.FOSSA_API_KEY != '' && github.ref == 'refs/heads/master'
run: |
curl -H 'Cache-Control: no-cache' https://raw.githubusercontent.com/fossas/fossa-cli/master/install.sh | sudo bash
fossa analyze
env:
FOSSA_API_KEY: ${{ secrets.FOSSA_API_KEY }}

- name: Install Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}

- name: Checkout
uses: actions/checkout@v4
with:
lfs: true

- name: Go Test
env:
CGO_CXXFLAGS: "-Werror"
run: go test -v -coverprofile c.out ./...

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
env:
OS: ${{ matrix.platform }}
GO: ${{ matrix.go-version }}
with:
files: ./c.out
env_vars: OS,GO

- name: Add GOPATH to GITHUB_ENV
run: echo "GOPATH=$(go env GOPATH)" >>"$GITHUB_ENV"

- name: Scan and upload FOSSA data (Linux/Mac)
if: env.FOSSA_API_KEY != '' && github.ref == 'refs/heads/master'
run: |
curl -H 'Cache-Control: no-cache' https://raw.githubusercontent.com/fossas/fossa-cli/master/install.sh | sudo bash
fossa analyze
env:
FOSSA_API_KEY: ${{ secrets.FOSSA_API_KEY }}
8 changes: 7 additions & 1 deletion .github/workflows/v8build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,28 @@ jobs:
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
lfs: true
submodules: true
fetch-depth: 1

- name: Update depot_tools fetch config
run: cd deps/depot_tools && git config --unset-all remote.origin.fetch; git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/*
shell: bash

- name: Install g++-aarch64-linux-gnu
if: matrix.platform == 'ubuntu-22.04' && matrix.arch == 'arm64'
run: sudo apt update && sudo apt install g++-aarch64-linux-gnu -y

- name: Build V8 linux
if: matrix.platform == 'ubuntu-22.04'
run: cd deps && ./build.py --no-clang --arch ${{ matrix.arch }}

- name: Build V8 macOS
if: matrix.platform == 'macos-13'
run: cd deps && pip3 install setuptools && ./build.py --arch ${{ matrix.arch }}

- name: Create PR
uses: peter-evans/create-pull-request@v5
with:
Expand Down
80 changes: 42 additions & 38 deletions .github/workflows/v8upgrade.yml
Original file line number Diff line number Diff line change
@@ -1,42 +1,46 @@
name: V8 Upgrade

on:
workflow_dispatch:
schedule:
- cron: '0 0 * * *' # Run every day
on: [workflow_dispatch]

jobs:
upgrade:
name: Upgrade V8
runs-on: ubuntu-18.04
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: true
fetch-depth: 0
- uses: actions/setup-python@v2
with:
python-version: '3.8'
- name: Update depot_tools fetch config
run: cd deps/depot_tools && git config --unset-all remote.origin.fetch; git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/*
shell: bash
- name: Add depot_tools to PATH
run: echo "$PWD/deps/depot_tools" >> $GITHUB_PATH
shell: bash
- name: Run upgrade script
run: cd deps && python upgrade_v8.py
- name: Create PR metadata
id: pr_metadata
run: |
echo ::set-output name=pr_branch::"v8_$(cat deps/v8_version)_upgrade"
echo ::set-output name=pr_commit_message::"Upgrade V8 binaries for $(cat deps/v8_version) version"
echo ::set-output name=pr_body::"Auto-generated pull request to upgrade V8 binary for $(cat deps/v8_version) version"
- name: Create PR
uses: peter-evans/create-pull-request@v3
with:
commit-message: ${{steps.pr_metadata.outputs.pr_commit_message}}
branch: ${{steps.pr_metadata.outputs.pr_branch}}
delete-branch: true
title: ${{steps.pr_metadata.outputs.pr_commit_message}}
body: ${{steps.pr_metadata.outputs.pr_body}}
upgrade:
name: Upgrade V8
runs-on: ubuntu-18.04
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: true
fetch-depth: 0

- uses: actions/setup-python@v2
with:
python-version: "3.8"

- name: Update depot_tools fetch config
run: cd deps/depot_tools && git config --unset-all remote.origin.fetch; git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/*
shell: bash

- name: Add depot_tools to PATH
run: echo "$PWD/deps/depot_tools" >> $GITHUB_PATH
shell: bash

- name: Run upgrade script
run: cd deps && python upgrade_v8.py

- name: Create PR metadata
id: pr_metadata
run: |
echo ::set-output name=pr_branch::"v8_$(cat deps/v8_version)_upgrade"
echo ::set-output name=pr_commit_message::"Upgrade V8 binaries for $(cat deps/v8_version) version"
echo ::set-output name=pr_body::"Auto-generated pull request to upgrade V8 binary for $(cat deps/v8_version) version"
- name: Create PR
uses: peter-evans/create-pull-request@v3
with:
token: ${{ secrets.TOKEN }}
commit-message: ${{steps.pr_metadata.outputs.pr_commit_message}}
branch: ${{steps.pr_metadata.outputs.pr_branch}}
delete-branch: true
title: ${{steps.pr_metadata.outputs.pr_commit_message}}
body: ${{steps.pr_metadata.outputs.pr_body}}

0 comments on commit 6dbb9c1

Please sign in to comment.