Skip to content

Commit

Permalink
CI: Only use approved GitHub Actions
Browse files Browse the repository at this point in the history
This also brings the workflow files inline what is in the os repo

Signed-off-by: Brennan Ashton <bashton@brennanashton.com>
  • Loading branch information
btashton authored and Ouss4 committed Dec 29, 2020
1 parent a4f240e commit c6ee2bf
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 58 deletions.
76 changes: 36 additions & 40 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ jobs:
ref: ${{ steps.gittargets.outputs.os_ref }}
path: sources/nuttx
fetch-depth: 1
- name: Checkout nuttx repo tags
run: git -C sources/nuttx fetch --tags

- name: Checkout apps repo
uses: actions/checkout@v2
Expand All @@ -102,8 +104,8 @@ jobs:
path: sources/testing
fetch-depth: 1

- name: Create Source Bundle
run: tar -czf sources.tar.gz sources
- name: Tar sources
run: tar zcf sources.tar.gz sources
- name: Archive Source Bundle
uses: actions/upload-artifact@v1
with:
Expand All @@ -125,10 +127,9 @@ jobs:
uses: actions/download-artifact@v1
with:
name: source-bundle
path: ./
- name: Extract Source Artifact
run: tar -xf sources.tar.gz

path: .
- name: Extract sources
run: tar zxf sources.tar.gz
- name: Docker Login
uses: azure/docker-login@v1
with:
Expand All @@ -137,32 +138,27 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}

- name: Docker Pull
uses: nick-invision/retry@v1
with:
timeout_minutes: 10
max_attempts: 3
retry_wait_seconds: 10
command: docker pull docker.pkg.github.com/apache/incubator-nuttx-testing/nuttx-ci-linux

run: docker pull docker.pkg.github.com/apache/incubator-nuttx-testing/nuttx-ci-linux
- name: Export NuttX Repo SHA
run: echo "nuttx_sha=`git -C sources/nuttx rev-parse HEAD`" >> $GITHUB_ENV
- name: Refresh Git Credentials
uses: actions/checkout@v2
with:
repository: apache/incubator-nuttx
ref: ${{ env.nuttx_sha }}
path: sources/nuttx
fetch-depth: 1
- name: Get Tags for NuttX Repo
run: git -C sources/nuttx fetch --tags
run: echo "nuttx_sha=`git -C sources/nuttx rev-parse HEAD`" >> $GITHUB_ENV
- name: Run builds
uses: ./sources/testing/.github/actions/ci-container
env:
BLOBDIR: /tools/blobs
with:
run: |
echo "::add-matcher::sources/nuttx/.github/gcc.json"
export CCACHE_DIR=`pwd`/ccache
mkdir $CCACHE_DIR
cd sources/testing
./cibuild.sh testlist/${{matrix.boards}}.dat
export ARTIFACTDIR=`pwd`/../../buildartifacts
./cibuild.sh -A -c testlist/${{matrix.boards}}.dat
ccache -s
- uses: actions/upload-artifact@v2
with:
name: linux-builds
path: buildartifacts/
continue-on-error: true

macOS:
runs-on: macos-10.15
Expand All @@ -175,31 +171,31 @@ jobs:
uses: actions/download-artifact@v1
with:
name: source-bundle
path: ./
- name: Extract Source Artifact
run: tar -xf sources.tar.gz

path: .
- name: Extract sources
run: tar zxf sources.tar.gz
- name: Restore Tools Cache
id: cache-tools
uses: actions/cache@v1
uses: actions/cache@v2
env:
cache-name: ${{ runner.os }}-cache-tools
with:
path: prebuilt
key: ${{ runner.os }}-tools-${{ hashFiles('./sources/testing/cibuild.sh') }}

- name: Export NuttX Repo SHA
run: echo "nuttx_sha=`git -C sources/nuttx rev-parse HEAD`" >> $GITHUB_ENV
- name: Refresh Git Credentials
uses: actions/checkout@v2
with:
repository: apache/incubator-nuttx
ref: ${{ env.nuttx_sha }}
path: sources/nuttx
fetch-depth: 1
- name: Get Tags for NuttX Repo
run: git -C sources/nuttx fetch --tags
run: echo "nuttx_sha=`git -C sources/nuttx rev-parse HEAD`" >> $GITHUB_ENV
- name: Run Builds
run: |
echo "::add-matcher::sources/nuttx/.github/gcc.json"
export CCACHE_DIR=`pwd`/ccache
mkdir $CCACHE_DIR
cd sources/testing
./cibuild.sh -i testlist/${{matrix.boards}}.dat
export ARTIFACTDIR=`pwd`/../../buildartifacts
./cibuild.sh -i -A -c testlist/${{matrix.boards}}.dat
ccache -s
- uses: actions/upload-artifact@v2
with:
name: macos-builds
path: buildartifacts/
continue-on-error: true
38 changes: 20 additions & 18 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,25 @@ jobs:
runs-on: ubuntu-18.04

steps:
- name: Checkout apps repo
uses: actions/checkout@v2
with:
path: apps
fetch-depth: 0
- name: Checkout nuttx repo
uses: actions/checkout@v2
with:
repository: apache/incubator-nuttx
path: nuttx
fetch-depth: 0

- name: Checkout nuttx repo
uses: actions/checkout@v2
with:
repository: apache/incubator-nuttx
path: nuttx
fetch-depth: 0
- name: Checkout apps repo
uses: actions/checkout@v2
with:
repository: apache/incubator-nuttx-apps
path: apps
fetch-depth: 0

- name: Check Pull Request
run: |
cd apps
commits="${{ github.event.pull_request.base.sha }}..HEAD"
git log --oneline $commits
echo "../nuttx/tools/checkpatch.sh -g $commits"
../nuttx/tools/checkpatch.sh -g $commits
- name: Check Pull Request
run: |
echo "::add-matcher::nuttx/.github/nxstyle.json"
cd apps
commits="${{ github.event.pull_request.base.sha }}..HEAD"
git log --oneline $commits
echo "../nuttx/tools/checkpatch.sh -g $commits"
../nuttx/tools/checkpatch.sh -g $commits
15 changes: 15 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: ❄️ Lint

on: [pull_request]

jobs:
yamllint:
name: 🍺 YAML
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: 🧹 YAML Lint
uses: github/super-linter@v3
env:
VALIDATE_YAML: true
FILTER_REGEX_INCLUDE: .*\.github/.*

0 comments on commit c6ee2bf

Please sign in to comment.