From c6ee2bf1402dbae03035116ea46186d53b4aa9d7 Mon Sep 17 00:00:00 2001 From: Brennan Ashton Date: Tue, 29 Dec 2020 13:51:02 -0800 Subject: [PATCH] CI: Only use approved GitHub Actions This also brings the workflow files inline what is in the os repo Signed-off-by: Brennan Ashton --- .github/workflows/build.yml | 76 ++++++++++++++++++------------------- .github/workflows/check.yml | 38 ++++++++++--------- .github/workflows/lint.yml | 15 ++++++++ 3 files changed, 71 insertions(+), 58 deletions(-) create mode 100644 .github/workflows/lint.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0d1e87158b..c453d31f8b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 @@ -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: @@ -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: @@ -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 @@ -175,13 +171,12 @@ 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: @@ -189,17 +184,18 @@ jobs: 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 diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 73434ce58a..76020d164f 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -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 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000000..9cd105e231 --- /dev/null +++ b/.github/workflows/lint.yml @@ -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/.*