-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci/build: rework the usage of docker container
- Loading branch information
Showing
7 changed files
with
141 additions
and
145 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 @@ | ||
FROM ghcr.io/shanteacontrols/opendeck:latest |
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
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 |
---|---|---|
|
@@ -2,74 +2,113 @@ name: CI | |
|
||
on: [push] | ||
|
||
defaults: | ||
run: | ||
shell: bash -leo pipefail {0} | ||
|
||
env: | ||
CCACHE_DIR: /__w/OpenDeck/OpenDeck/ccache | ||
|
||
jobs: | ||
build_and_test_ubuntu: | ||
name: Build/Test [Ubuntu] | ||
runs-on: ubuntu-22.04 | ||
container: | ||
image: ghcr.io/shanteacontrols/opendeck:latest | ||
options: --user root | ||
build: | ||
name: Build/Test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Mark repository as safe | ||
run: git config --global --add safe.directory /__w/OpenDeck/OpenDeck | ||
- name: Pull the repository and submodules | ||
- name: Pull the repository | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
submodules: recursive | ||
- name: Restore ccache | ||
uses: actions/cache/restore@v4 | ||
with: | ||
path: | | ||
ccache | ||
key: ccache-key | ||
- name: Build and test targets | ||
path: ccache | ||
key: ccache- | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Setup missing directories and files on the runner | ||
run: | | ||
git fetch --tags | ||
./scripts/build_targets.sh --type=build | ||
./scripts/build_targets.sh --type=test | ||
mkdir -p ~/.ssh | ||
touch ~/.gitconfig | ||
- name: Prepare container | ||
uses: devcontainers/[email protected] | ||
with: | ||
imageName: opendeck # Local name only | ||
imageTag: latest # Local tag only | ||
push: never | ||
- name: Build and test targets | ||
uses: devcontainers/[email protected] | ||
with: | ||
imageName: opendeck | ||
imageTag: latest | ||
push: never | ||
runCmd: | | ||
git fetch --tags | ||
./scripts/build_targets.sh --type=build | ||
./scripts/build_targets.sh --type=test | ||
- name: Save ccache | ||
uses: actions/cache/save@v4 | ||
if: always() | ||
with: | ||
path: | | ||
ccache | ||
key: ccache-key | ||
path: ccache | ||
key: "ccache-${{ github.run_id }}" | ||
format: | ||
name: Code formatting | ||
runs-on: ubuntu-22.04 | ||
container: | ||
image: ghcr.io/shanteacontrols/opendeck:latest | ||
options: --user root | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Mark repository as safe | ||
run: git config --global --add safe.directory /__w/OpenDeck/OpenDeck | ||
- uses: actions/checkout@v4 | ||
- name: Pull the repository | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
submodules: recursive | ||
- name: Check formatting | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Setup missing directories and files on the runner | ||
run: | | ||
make format | ||
mkdir -p ~/.ssh | ||
touch ~/.gitconfig | ||
- name: Prepare container | ||
uses: devcontainers/[email protected] | ||
with: | ||
imageName: opendeck # Local name only | ||
imageTag: latest # Local tag only | ||
push: never | ||
- name: Check formatting | ||
uses: devcontainers/[email protected] | ||
with: | ||
imageName: opendeck | ||
imageTag: latest | ||
push: never | ||
runCmd: | | ||
make format | ||
lint: | ||
name: Code linting | ||
runs-on: ubuntu-22.04 | ||
container: | ||
image: ghcr.io/shanteacontrols/opendeck:latest | ||
options: --user root | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Mark repository as safe | ||
run: git config --global --add safe.directory /__w/OpenDeck/OpenDeck | ||
- uses: actions/checkout@v4 | ||
- name: Pull the repository | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
submodules: recursive | ||
- name: Lint | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Setup missing directories and files on the runner | ||
run: | | ||
./scripts/build_targets.sh --type=lint | ||
mkdir -p ~/.ssh | ||
touch ~/.gitconfig | ||
- name: Prepare container | ||
uses: devcontainers/[email protected] | ||
with: | ||
imageName: opendeck # Local name only | ||
imageTag: latest # Local tag only | ||
push: never | ||
- name: Check formatting | ||
uses: devcontainers/[email protected] | ||
with: | ||
imageName: opendeck | ||
imageTag: latest | ||
push: never | ||
runCmd: | | ||
./scripts/build_targets.sh --type=lint |
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 |
---|---|---|
|
@@ -4,33 +4,42 @@ on: | |
release: | ||
types: [created] | ||
|
||
defaults: | ||
run: | ||
shell: bash -leo pipefail {0} | ||
|
||
jobs: | ||
build: | ||
name: Attach firmware to release | ||
runs-on: ubuntu-22.04 | ||
container: | ||
image: ghcr.io/shanteacontrols/opendeck:latest | ||
options: --user root | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Mark repository as safe | ||
run: git config --global --add safe.directory /__w/OpenDeck/OpenDeck | ||
- name: Pull the repository and submodules | ||
- name: Pull the repository | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
submodules: recursive | ||
- name: Build | ||
run: | | ||
git fetch --tags | ||
./scripts/build_targets.sh --type=build | ||
./scripts/copy_release_binaries.sh --build-dir=build --copy-dir=release | ||
- name: Upload | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Setup missing directories and files on the runner | ||
run: | | ||
tag_name="${GITHUB_REF##*/}" | ||
hub release edit $(find ./release -type f -printf "-a %p ") -m "" "$tag_name" | ||
mkdir -p ~/.ssh | ||
touch ~/.gitconfig | ||
- name: Prepare container | ||
uses: devcontainers/[email protected] | ||
with: | ||
imageName: opendeck # Local name only | ||
imageTag: latest # Local tag only | ||
push: never | ||
env: | | ||
GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} | ||
- name: Build and upload | ||
uses: devcontainers/[email protected] | ||
with: | ||
imageName: opendeck | ||
imageTag: latest | ||
push: never | ||
runCmd: | | ||
git fetch --tags | ||
./scripts/build_targets.sh --type=build | ||
./scripts/copy_release_binaries.sh --build-dir=build --copy-dir=release | ||
tag_name="${GITHUB_REF##*/}" | ||
hub release edit $(find ./release -type f -printf "-a %p ") -m "" "$tag_name" |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.